Thursday, November 1, 2007

Removing special characters from query string values using javascript

Query string parameters can not include specific characters. One of the easiest ways of removing these characters, is through using JavaScript encodeURI function.

var encodedString=encodeURI("URI String");

To get the original string use the following function:

var decodedString=decodeURI("URI%20String"));

No comments: