开发者

Javascript onclick and escapes

If my onclick event looks like:

<input ....开发者_开发技巧 onclick="someEvent('blah', '/some/folder/?a=1')" />

Should the ? character be escaped?


For the purpose of passing the string parameter to someEvent, you don't need to escape the ?.

How you use the parameter in the event handler is another question, though on a URL it should be fine.


In your simplified example it's fine as is. It's no different than passing it a question, ie What is for dinner?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜