Results 1 to 3 of 3
Jun 13, 2006, 16:30 #1
AJAX Post information includeing &
Im guessing its quite simple, but ive been googling for a while and still not found what im looking for.
Basically my news system POSTS an xmlhttp request containing the news, this news often includes urls which have the symbol "&" in them.
The problem is, when ever an & appears in the send, the news gets cut off
The reason is quite obvious, since its simply considering it a new post header.
xmlhttp.send("title=" + ctitle + "&comment=" + ccom);
Thanks in advance
Jun 13, 2006, 19:24 #2
- Join Date
- Jul 2005
- West Springfield, Massachusetts
- 198 Post(s)
- 3 Thread(s)
Using only & in URLs causes problems because entities begin with them. You could try
xmlhttp.send("title=" + ctitle + "&amp;comment=" + ccom);
var send_str = "title=" + ctitle + "&comment=" + ccom; var encoded_str = escape(send_str); xmlhttp.send(encoded_str);Big Change Coming Soon - if you want your PMs save them now!
What you need to do to prepare for our migration to Discourse
A New SitePoint Forum Experience: Our Move to Discourse
Jun 14, 2006, 09:40 #3
Ah thanks the second suggestions worked great, although i had to change slightly so as not to filter the & i actually did want
xmlhttp.send("title=" + escape(title) + "&cat=" + escape(cat) + "&update=" + escape(update) + "&news=" + escape(news) + "");