AJAX Callback with large amount of text

Discussion in 'Javascript' started by eggie5@gmail.com, Sep 28, 2006.

  1. Guest

    OK, so I'm trying to get a large amount of text back to my ASP script
    on the server. My large amount of text is the source to a web page, and
    I want to preserve the formatting on it, ie the indenting. Before any
    of this the only way I got stuff back to the server is with query
    strings. Now I'm pretty sure there's other ways to get data back to the
    sever besides query stings but I'm having trouble finding them. Can
    somebody point me in the right direction or tell me how?
     
    , Sep 28, 2006
    #1
    1. Advertising

  2. Hi,

    wrote:
    > OK, so I'm trying to get a large amount of text back to my ASP script
    > on the server. My large amount of text is the source to a web page, and
    > I want to preserve the formatting on it, ie the indenting. Before any
    > of this the only way I got stuff back to the server is with query
    > strings. Now I'm pretty sure there's other ways to get data back to the
    > sever besides query stings but I'm having trouble finding them. Can
    > somebody point me in the right direction or tell me how?


    You can use POST with XmlHttpRequest.

    Greetings,
    Laurent
    --
    Laurent Bugnion, GalaSoft
    Software engineering: http://www.galasoft-LB.ch
    PhotoAlbum: http://www.galasoft-LB.ch/pictures
    Support children in Calcutta: http://www.calcutta-espoir.ch
     
    Laurent Bugnion, Sep 28, 2006
    #2
    1. Advertising

  3. handy Guest

    use "POST" method
     
    handy, Sep 29, 2006
    #3
  4. <> wrote in message
    news:...
    > OK, so I'm trying to get a large amount of text back to my ASP script
    > on the server. My large amount of text is the source to a web page, and
    > I want to preserve the formatting on it, ie the indenting. Before any
    > of this the only way I got stuff back to the server is with query
    > strings. Now I'm pretty sure there's other ways to get data back to the
    > sever besides query stings but I'm having trouble finding them. Can
    > somebody point me in the right direction or tell me how?
    >

    As folk have said, use POST method, which probably involves you learning to
    do this sort of thing:
    var sendStr, field1='Some text', field2='some more text', reqxml = new
    XMLHttpRequest();
    reqxml.open("POST", "servercode.asp", true);
    reqxml.setRequestHeader("Content-Type",
    "application/x-www-form-urlencoded") /* IMPORTANT */
    sendStr = 'field1=' + encodeURIComponent(field1) + '&field2=' +
    encodeURIComponent(field2);
    reqxml.send(sendStr);

    server ASP code access request.form("field1"), request.form("field2")

    ---good luck
    ---Bruce Wisentaner
     
    Bruce Wisentaner, Sep 29, 2006
    #4
  5. Guest

    Thanks, I'm doing this now with prototype and it works great!


    Laurent Bugnion wrote:
    > Hi,
    >
    > wrote:
    > > OK, so I'm trying to get a large amount of text back to my ASP script
    > > on the server. My large amount of text is the source to a web page, and
    > > I want to preserve the formatting on it, ie the indenting. Before any
    > > of this the only way I got stuff back to the server is with query
    > > strings. Now I'm pretty sure there's other ways to get data back to the
    > > sever besides query stings but I'm having trouble finding them. Can
    > > somebody point me in the right direction or tell me how?

    >
    > You can use POST with XmlHttpRequest.
    >
    > Greetings,
    > Laurent
    > --
    > Laurent Bugnion, GalaSoft
    > Software engineering: http://www.galasoft-LB.ch
    > PhotoAlbum: http://www.galasoft-LB.ch/pictures
    > Support children in Calcutta: http://www.calcutta-espoir.ch
     
    , Oct 6, 2006
    #5
    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. James
    Replies:
    29
    Views:
    2,187
    Dale King
    Apr 15, 2006
  2. Thomas Pototschnig

    Need a large amount of memory!

    Thomas Pototschnig, Apr 30, 2005, in forum: Java
    Replies:
    1
    Views:
    363
    Harald
    Apr 30, 2005
  3. Replies:
    0
    Views:
    427
  4. Replies:
    2
    Views:
    559
  5. dreamvigile

    how to read in large amount of data in C?

    dreamvigile, Jul 18, 2003, in forum: C Programming
    Replies:
    0
    Views:
    345
    dreamvigile
    Jul 18, 2003
Loading...

Share This Page