Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: Script to load webpage from text file

  1. #1
    Join Date
    Apr 2005
    Posts
    1,333
    Rep Power
    0

    Default Script to load webpage from text file

    OK,

    does anybody know of any scripts (preferably Javascript or vbscript) that will read text from a text file and place it into the body of a webpage?

    The webpage is static html (well, with some client side scripting). I am searching google, but that's a nightmare.
    The fox was probably right - they could have been sour grapes.

  2. #2
    Join Date
    Sep 2004
    Posts
    281
    Rep Power
    0

    Default

    if its possible for you to take the text and place it in a xml file you could use
    XSLT and the xml to generate the HTML page. IE&FF can handle the xslt, more than likely there are javascript libs out there to do it for you.
    On the vbscript side. there is an object that will allow you to access the file system

    <&#37;@ LANGUAGE=VBScript %>
    <HTML>
    <BODY>
    <%
    Dim objFS, objFile, append
    append = 8
    Set objFS = Server.CreateObject("Scripting.FileSystemObject")
    Set objFile = objFs.OpenTextFile("c:\servlist.txt", append, True )
    objFile.WriteLine Request.ServerVariables("SERVER_NAME")
    objFile.Close
    %>
    Done
    </BODY>
    </HTML>
    Anything or Anyone that fails to grow will eventually die. {AI}
    -------------------------------------------------
    Tomorrow is the future!
    Today Is the Tomorrow you made Yesterday!{AI}

  3. #3
    Join Date
    Apr 2005
    Posts
    1,333
    Rep Power
    0

    Default

    Listen, thanks for the suggestion, but that looks like asp code. I do not want to do this in asp.k I just want a client side script to read the text from the file.

    I do not want to use any server side scripting.
    The fox was probably right - they could have been sour grapes.

  4. #4
    Join Date
    Dec 2002
    Posts
    500
    Rep Power
    0

    Default

    http://en.wikipedia.org/wiki/AHAHthis sould be good enough
    Cultured in Aggression and Koding like a Warrior!!
    “Common sense is instinct. Enough of it is genius.” - George Bernard Shaw.
    "The significant problems we face cannot be solved by the same level of thinking that created them." - Albert Einstein

  5. #5
    girldemsuga Guest

    Default

    Quote Originally Posted by icymint3 View Post
    http://en.wikipedia.org/wiki/AHAHthis sould be good enough
    I checked the link you posted but i tried googling to find a tutorial but having no luck.

    Do you have a tutorial or something which could give a basic idea of how this is done (AHAH)

  6. #6
    Join Date
    May 2003
    Posts
    108
    Rep Power
    0

    Default

    Browser scripts (javascript/vbscript) will not allow acess to files on the client's computer. Do you know how risky that would be. Imagine able to read files from the client's computer and posting it back to the server.

  7. #7
    Join Date
    Mar 2003
    Posts
    492
    Rep Power
    0

    Default

    Quote Originally Posted by fatta77 View Post
    Browser scripts (javascript/vbscript) will not allow acess to files on the client's computer. Do you know how risky that would be. Imagine able to read files from the client's computer and posting it back to the server.
    Read this. Look at the post about handling local files. M$ is trying to allow browser widgets access to local files. Talk about poking holes in your security platform.

  8. #8
    Join Date
    Dec 2002
    Posts
    500
    Rep Power
    0

    Default

    Quote Originally Posted by girldemsuga View Post
    I checked the link you posted but i tried googling to find a tutorial but having no luck.

    Do you have a tutorial or something which could give a basic idea of how this is done (AHAH)
    examples
    http://www.gizax.it/ahahsection/

    documentation
    http://microformats.org/wiki/rest/ahah

    u right theres not much in terms of tutorials... but if u code js then it easy to integrate (or dismantle). if it too tough fi u, just use something closer to home.
    Cultured in Aggression and Koding like a Warrior!!
    “Common sense is instinct. Enough of it is genius.” - George Bernard Shaw.
    "The significant problems we face cannot be solved by the same level of thinking that created them." - Albert Einstein

  9. #9
    Join Date
    May 2003
    Posts
    108
    Rep Power
    0

    Default

    Icymint3, this is AJAX (javascript). Javascript will not allow reading files from the client's machine.

  10. #10
    Join Date
    Dec 2002
    Posts
    500
    Rep Power
    0

    Default

    Its not clear whether he wanted to pull in a local file from the client machine or a file already on the (web) server...CyberCat clarify?
    Cultured in Aggression and Koding like a Warrior!!
    “Common sense is instinct. Enough of it is genius.” - George Bernard Shaw.
    "The significant problems we face cannot be solved by the same level of thinking that created them." - Albert Einstein

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •