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?
精彩评论