appending to a text file

Discussion in 'Javascript' started by llama.named.sue@gmail.com, Jun 4, 2007.

  1. Guest

    hey,
    Can someone please tell me is it possible to append to a text file
    using javascript?I've read that you can and that you can't and I'm
    lost now!I heard you can get around it by using xml?I need to read in
    information from a prompt box and append it to an existing text file
    which is currently called helloworld.txt. any ideas on what is the
    most appropriate way to do this?Any help is appreciated.
    thanks!


    <img onclick="showCoords(event)" src="http://www.tuam-guide.com/
    images/galway-city-map.gif" alt="Galway Map" />


    <script type="text/javascript">

    var destination
    var coords = new Array(4)
    var email
    function showCoords(event){
    if (destination==0) {
    coords[2] = event.clientX
    coords[3] = event.clientY
    destination=1

    if(confirm("would you like to view matches?"))
    {
    email = prompt("Please enter your email address","")

    }

    else

    {
    alert("Thank you for visiting")

    }

    }


    else {
    coords[0] = event.clientX
    coords[1] = event.clientY
    destination=0
    alert("Click on destination.")





    }
    }



    </script>
     
    , Jun 4, 2007
    #1
    1. Advertising

  2. Tim Slattery Guest

    wrote:

    >hey,
    > Can someone please tell me is it possible to append to a text file
    >using javascript?


    Not on the client side. You do not have access to the client's file
    system.

    --
    Tim Slattery

    http://members.cox.net/slatteryt
     
    Tim Slattery, Jun 4, 2007
    #2
    1. Advertising

  3. Guest

    On Jun 4, 9:08 pm, Tim Slattery <> wrote:
    > wrote:
    > >hey,
    > > Can someone please tell me is it possible to append to a text file
    > >using javascript?

    >
    > Not on the client side. You do not have access to the client's file
    > system.
    >
    > --
    > Tim Slattery
    > ://members.cox.net/slatteryt

    ok,thanks.
     
    , Jun 4, 2007
    #3
  4. Hal Rosser Guest

    <> wrote in message
    news:...
    > hey,
    > Can someone please tell me is it possible to append to a text file
    > using javascript?I've read that you can and that you can't and I'm
    > lost now!I heard you can get around it by using xml?I need to read in
    > information from a prompt box and append it to an existing text file
    > which is currently called helloworld.txt. any ideas on what is the
    > most appropriate way to do this?Any help is appreciated.
    > thanks!
    >


    If the text file is on the server, you can use ASP with server-side
    Javascript, but you can not write to a file from JavaScript that's on an
    html page in <script> tags.
     
    Hal Rosser, Jun 4, 2007
    #4
  5. Guest

    On Jun 4, 11:53 pm, "Hal Rosser" <> wrote:
    > <> wrote in message
    >
    > news:...
    >
    > > hey,
    > > Can someone please tell me is it possible to append to a text file
    > > using javascript?I've read that you can and that you can't and I'm
    > > lost now!I heard you can get around it by using xml?I need to read in
    > > information from a prompt box and append it to an existing text file
    > > which is currently called helloworld.txt. any ideas on what is the
    > > most appropriate way to do this?Any help is appreciated.
    > > thanks!

    >
    > If the text file is on the server, you can use ASP with server-side
    > Javascript, but you can not write to a file from JavaScript that's on an
    > html page in <script> tags.


    thanks for info:)
     
    , Jun 5, 2007
    #5
  6. Bob Guest

    On 5 Jun, 01:03, wrote:
    > On Jun 4, 11:53 pm, "Hal Rosser" <> wrote:
    >
    >
    >
    >
    >
    > > <> wrote in message

    >
    > >news:...

    >
    > > > hey,
    > > > Can someone please tell me is it possible to append to a text file
    > > > using javascript?I've read that you can and that you can't and I'm
    > > > lost now!I heard you can get around it by using xml?I need to read in
    > > > information from a prompt box and append it to an existing text file
    > > > which is currently called helloworld.txt. any ideas on what is the
    > > > most appropriate way to do this?Any help is appreciated.
    > > > thanks!

    >
    > > If the text file is on the server, you can use ASP with server-side
    > > Javascript, but you can not write to a file from JavaScript that's on an
    > > html page in <script> tags.

    >
    > thanks for info:)- Hide quoted text -
    >
    > - Show quoted text -


    If you use a cookie you can write to a file on the client's 'puter.
     
    Bob, Jun 5, 2007
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. clintonG
    Replies:
    2
    Views:
    5,207
    clintonG
    Jan 22, 2007
  2. Jim in Arizona
    Replies:
    0
    Views:
    778
    Jim in Arizona
    May 8, 2009
  3. Tapanan Yeophantong

    Appending Text to File - Please Help!!!

    Tapanan Yeophantong, Oct 18, 2003, in forum: ASP General
    Replies:
    1
    Views:
    155
    Ray at
    Oct 18, 2003
  4. Paul Danese
    Replies:
    1
    Views:
    136
    Stefano Crocco
    Jun 14, 2007
  5. Replies:
    3
    Views:
    162
    Klaus Eichner
    Jul 20, 2005
Loading...

Share This Page