• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

XMLHttpRequest issue while using Special characters

 
Ranch Hand
Posts: 415
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ??
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You need to escape your string like a form submission does:

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

Eric
 
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Eric and ramesh

Thanks for the help , i resolved it using the escape method in javascript
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic