Announcement

Collapse
No announcement yet.

Help: OpentextFile in Jscript

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Help: OpentextFile in Jscript

    Hi there,
    I would appreciate it if nyone could help me with the following problem. I am not very familiar with java script, but taught myself bit.
    I have a data stored in a text file that needs to be loaded into a textarea on my site. The jscript I have added to the end of my html page and it works
    fine on my computer's browser. However, the scipt runs on my website but it seems that the OpenTextFile statment in my code does not work. I think that the path
    to the rext file is'nt correct but dont know how to create the correct path.
    My script looks as follows:
    <SCRIPT LANGUAGE="JScript">
    var Ta = TextArea1
    var fso, f1, ts, s;
    var ForReading = 1;
    fso = new ActiveXObject("Scripting.FileSystemObject");
    ts = fso.OpenTextFile("./Quotations.txt", ForReading);
    s = ts.ReadAll();
    Ta.value=s;
    ts.Close();
    </SCRIPT>
    The textfile called "Quotations.txt" is stored under public_html/Quotations/Quotations.txt
    You can view my site at www.webworths.com, and click on link on the index page called "Click here to view details"
    Thank you in advance
Working...
X