我们有特殊字符时发生错误
<input value="Search Today's Deals" onfocus="if(this.getValue() == 'Search Today's Deals'){this.setValue('')}" />
当我点击此文本框时,它会显示问题:
Failed to processs FBML JavaScript. Exception = "Javascript parse error, unexpected: RCURLY"
请帮我解决一下。
答案 0 :(得分:0)
我认为单引号中的单引号需要转义: 试试这段代码:
<input value="Search Today's Deals" onfocus="if(this.getValue() == 'Search Today\'s Deals'){this.setValue('')}" />