开发者

Is it possible to send special character in parameter values in url path?

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开发者_StackOverflow社区 fine but throwing javascript error when the value contains special character. Please help to resolve this issue. Thanks in advance.


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.


Look up the Javascript built-in escape function.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜