当前位置: 代码迷 >> Java Web开发 >> moz-bindings.xml报错(fck)
  详细解决方案

moz-bindings.xml报错(fck)

热度:364   发布时间:2011-05-15 20:34:46.0
moz-bindings.xml报错(fck)
<?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 )        // Numbers
                            || (iCode >= 37 && iCode <= 40)        // Arrows
                            || iCode == 8                        // Backspace
                            || iCode == 46                        // Delete
                        ) ;

                    return bAccepted ;
               </body>
            </method>
        </implementation>
        <events>
            <event type="keypress" value="CheckIsDigit()" />
        </events>
    </binding>
</bindings>

红色区域报The content of elements must consist of well-formed character data or markup.错

----------------解决方案--------------------------------------------------------
加入<![CDATA[

]]>标签就没错了,不知对不对
----------------解决方案--------------------------------------------------------