More AJAX POST over GET Jul08 '06
Feedback
# (2 of 7): Mark
4 months, 3 weeks after the fact. (Sun 26 Nov 2006, 10:04 PM CST)
I'm having the same aggrivating issue with the POST request. The most annoying part is that i cannot possibly pass what i am doing through an ajax GET method query string either considering they cap off at 100 characters, my users most of the time will not send more than 100 characters through (it's a chatroom) but there's the posibility for it, and i'm not even positive that it wouldn't remove the spaces as well...
Seriously though, what freaking good is AJAX if you can't pass spaces through a POST request. I'll re-iterate your previous statement... IT'S a freaking POST for crying out loud... If ajax is supposed to emulate the post and get methods, it's done a rediculous job of it. What good is a string of text if it can only be one word in length?
Btw, to the above poster.. that won't work either. Tried it... setting a content type of text/xml also doesn't work, that's even worse... for my script it sent a null value.
Anyway, all i can say is i hope you're not using ajax to send this form data, this whole thing will be rather difficult to read... lmao.
If you figure it out buddy, you mind emailing me? I'd appreciate it sincerely :)
# (3 of 7): Mark
4 months, 3 weeks after the fact. (Sun 26 Nov 2006, 10:06 PM CST)
Nm, thank you i just read your next post there boss... thanks, you don't know how much of a life saver that is... i totally forgot about encodeURI() :)
You rock man, serious. :)
# (4 of 7): Matthom
4 months, 3 weeks after the fact. (Mon 27 Nov 2006, 7:46 AM CST)
Mark, make sure to read Jennifer's feedback regarding this. She clarified that it should be encodeURIComponent() instead of encodeURI().
Hope that helps.
# (5 of 7): Jim
9 months, 4 weeks after the fact. (Wed 02 May 2007, 1:37 PM CST)
encodeURIComponent() Helped me alot thanks!! it replaces naughty &?# and stuff for %[number] things.
# (6 of 7): Ergün KoÇak » websiteci.com
1 year, 7 months after the fact. (Thu 07 Feb 2008, 2:12 AM CST)
encodeURIComponent solved my problem with & + and % signs. i am new here and tnx very much :)
# (7 of 7): Sean
2 years after the fact. (Fri 25 Jul 2008, 9:55 AM CST)
Heh, looks like I'm on the same AJAX path as you exactly 2 years later... thanks for the blog entry!
RSS feed for comments on this post
Leave feedback
AJAX requests are becoming a pain the butt.
You are at the feedback permalink page for: More AJAX POST over GET
# (1 of 7): Octra Bond » tucomday.net
3 days, 11 hours after the fact. (Tue 11 Jul 2006, 9:45 PM CST)
You’d add this line before sending POST data.
xmlhttp.setRequestHeader(’Content-Type’, ’application/x-www-form-urlencoded;’);