Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

XMLHttpRequest issue while using Special characters

 
sreenath reddy
Ranch Hand
Posts: 415
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I am using XMLHttpRequest to send a call to the server for validating a few things .. while sending a call to the server , i am appending a variable using textbox (The value is entered by the user and it has some special characters like #%$..) , and then in the server i am not getting these parameters ....

The url for call to the server will look like "/url?user=!@#$"

I think the problem will be while using the GET method to place a call to the server

Can any one let me know how to resolve this ??
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to escape your string like a form submission does:

http://xkr.us/articles/javascript/encode-compare/

Eric
 
Ramesh Shanmugam
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i think better you can convert the special characters into UTF-8 charset and pass as Query String value.

Thanks
 
sreenath reddy
Ranch Hand
Posts: 415
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Eric and ramesh

Thanks for the help , i resolved it using the escape method in javascript
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic