1

当我们有特殊字符时发生错误

 <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"

请帮我解决它。

4

1 回答 1

0

我认为单引号中的单引号需要转义:试试这个代码:

 <input value="Search Today's Deals" onfocus="if(this.getValue() == 'Search Today\'s Deals'){this.setValue('')}" />
于 2011-02-07T11:07:25.877 回答