By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,400 Members | 1,368 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,400 IT Pros & Developers. It's quick & easy.

Ajax not able to save text with "%" and "&"

100+
P: 123
Ajax not able to save text with "%" and "&".

When text like "abc&123", once I click save, can save
"abc" only, all words after abc are not saved.

When text like "%", it will show an ERROR message
say xxx.php not found.

Code as below (xxx.js)..please help. thanks.

Expand|Select|Wrap|Line Numbers
  1. note=document.getElementById("note").value;
  2. url=url+"?note="+note;
  3.  
  4. url=encodeURI(url);
  5. url=url+"&sid="+Math.random();
  6.  
Apr 8 '11 #1
Share this Question
Share on Google+
1 Reply


gits
Expert Mod 5K+
P: 5,390
i guess you use a GET request - try a POST request, which should work ... otherwise you might try to replace the special chars with html-entities before sending it as a GET query-string.

kind regards
Apr 9 '11 #2

Post your reply

Sign in to post your reply or Sign up for a free account.