Results 1 to 3 of 3
Jun 13, 2006, 15: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, 18:24 #2
- Join Date
- Jul 2005
- West Springfield, Massachusetts
- 149 Post(s)
- 1 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);
Jun 14, 2006, 08: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) + "");