错误提示:the entity name must immediately follow the '&' in the entity reference代码如下:<?xml version="1.0" encoding="utf-8"?>
<bindings xmlns="http://www.mozilla.org/xbl">
<binding id="numericfield">
<implementation>
<constructor>
this.keypress = CheckIsDigit ;
</constructor>
<method name="CheckIsDigit">
<body>
var iCode = keyCode ; var bAccepted =
(
( iCode >= 48 && iCode <= 57 )
|| (iCode >= 37 && iCode <= 40) || iCode == 8 || iCode == 46) ; return bAccepted ;
</body>
</method>
</implementation>
<events>
<event type="keypress" value="CheckIsDigit()" />
</events>
</binding>
</bindings>
<bindings xmlns="http://www.mozilla.org/xbl">
<binding id="numericfield">
<implementation>
<constructor>
this.keypress = CheckIsDigit ;
</constructor>
<method name="CheckIsDigit">
<body>
var iCode = keyCode ; var bAccepted =
(
( iCode >= 48 && iCode <= 57 )
|| (iCode >= 37 && iCode <= 40) || iCode == 8 || iCode == 46) ; return bAccepted ;
</body>
</method>
</implementation>
<events>
<event type="keypress" value="CheckIsDigit()" />
</events>
</binding>
</bindings>
&=&
>=>;
<=<
"="
'='
<xsl:comment><![CDATA[
funcation()...]]></xsl:comment>不行的话再试试这个<!-- -->
funcation()... ]]>
...
]]>就可以了。
看看&&是英文字符吗?如果是
改成( iCode >= 48 || iCode <= 57 ) || (iCode >= 37 || iCode <= 40)
看看还会出现那个问题吗 如果还出现说明不是那个问题
不出现的话就用别的判断
> 替换成 >;
< 替换成 <
" 替换成 "
' 替换成 '
( iCode >= 48 <![CDATA[&&]]> iCode ≤ 57 )