469,271 Members | 1,435 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,271 developers. It's quick & easy.

AJAX Callback with large amount of text

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 '06 #1
4 2085
Hi,

eg****@gmail.com 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
Sep 28 '06 #2
use "POST" method

Sep 28 '06 #3
<eg****@gmail.comwrote in message
news:11*********************@m73g2000cwd.googlegro ups.com...
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


Sep 29 '06 #4
Thanks, I'm doing this now with prototype and it works great!
Laurent Bugnion wrote:
Hi,

eg****@gmail.com 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 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

24 posts views Thread by Larry | last post: by
5 posts views Thread by geekboy0001 | last post: by
cassbiz
12 posts views Thread by cassbiz | last post: by
reply views Thread by john_c | last post: by
3 posts views Thread by =?Utf-8?B?bWNpbWFnaW5n?= | last post: by
6 posts views Thread by =?Utf-8?B?U2hhd24gU2VzbmE=?= | last post: by
4 posts views Thread by KDawg44 | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.