aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes XMLHttpRequest issue while using Special characters Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "XMLHttpRequest issue while using Special characters" Watch "XMLHttpRequest issue while using Special characters" New topic
Author

XMLHttpRequest issue while using Special characters

sreenath reddy
Ranch Hand

Joined: Sep 21, 2003
Posts: 415
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

Joined: Nov 08, 2001
Posts: 15376
    
    6
You need to escape your string like a form submission does:

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

Eric
Ramesh Shanmugam
Ranch Hand

Joined: Sep 13, 2004
Posts: 132
i think better you can convert the special characters into UTF-8 charset and pass as Query String value.

Thanks


Ramesh Shanmugam - SCJP 1.5
sreenath reddy
Ranch Hand

Joined: Sep 21, 2003
Posts: 415
Eric and ramesh

Thanks for the help , i resolved it using the escape method in javascript
 
Consider Paul's rocket mass heater.
 
subject: XMLHttpRequest issue while using Special characters