Hi All:
I have an url link "Change", a pop up window will get open when the user clicks the link. During that time, some parameters with values also sending in the url. Some parameter values contains special characters (' eg: &name=D'LOREY&lname=VALENTINE). If the value is full of alphabets it is working fine but throwing javascript error when the value contains special character. Please help to resolve this issue. Thanks in advance.
views:
97answers:
2According to http://xkr.us/articles/javascript/encode-compare/ (the accuracy of which I cannot vouch for), `escape` is broken, use `encodeURIComponent`.
bdukes
2010-02-02 14:31:06
+6
A:
Use encodeURIComponent on both the name and the value for your parameter. It's supported in all the mainstream desktop browsers going back to IE 5.5. If you need to support IE 5, you'll have to make do with escape, which as noted elsewhere is not perfect.
Tim Down
2010-02-02 14:27:35