AJAX Callback with large amount of text

E

eggie5

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?
 
L

Laurent Bugnion

Hi,

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
 
B

Bruce Wisentaner

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top