开发者

Problem fbjs with special characters

开发者 https://www.devze.com 2023-01-23 01:28 出处:网络
An error occurred when we have special characters <input value=\"Search Today\'s Deals\" onfocus=\"if(this.getValue() == \'Search Today\'s Deals\'){this.setValue(\'\')}\" />

An error occurred when we have special characters

 <input value="Search Today's Deals" onfocus="if(this.getValue() == 'Search Today's Deals'){this.setValue('')}" />

When I click this textbox it show issue:

Failed to proces开发者_如何学Goss FBML JavaScript. Exception = "Javascript parse error, unexpected: RCURLY"

Please help me a way solve it.


I think the single quotes within single quotes need escaping: try this code :

 <input value="Search Today's Deals" onfocus="if(this.getValue() == 'Search Today\'s Deals'){this.setValue('')}" />
0

精彩评论

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