4

を使用してcustome.jsおりPIE.jsjquery1_7_2.jsファイルをjsp

これは私のcustome.jsであり、それ以上のものではありません。

jQuery(document).ready(function(){
   jQuery(function() {

    if (window.PIE) {
        jQuery('#login-box, .sign-button, .new-user-btn, .grey-btn, .code-btn, #contact-email, #contact-email .continue, #contact-email .cancel').each(function() {
            PIE.attach(this);
        });
    }

});

})

すべてのブラウザですべて正常に動作します。しかし、Firefoxではこのエラーが表示されます

Error: TypeError: PIE.attach is not a function
Source File: http://localhost:8080/MyApp/js/custom.js
Line: 6

この問題を解決するために私を導いてください。

編集: PIE.js のこの行にエラーが表示されます

window.attachEvent("onunload",a);fKsa=function(b,c,d){b.attachEvent(c,d);this.ba(function(){b.detachEvent(c,d)})} })();f.Qa=新しい f.ea;fKsa(window,"onresize",function(){f.Qa.wa()});(function(){function a(){f.mb. wa()}f.mb=new f.ea;fKsa(window,"onscroll",a);f.Qa.ba(a)})();(関数(){関数a(){c=f .kb.md()}関数 b(){if(c){for(var d=0,e=c.length;d

この行のcustome.js

PIE.attach(これ);

4

1 に答える 1

15

クロスブラウザにするためにイベントを添付する場合は、次の手順を実行します。

if (target.addEventListener) {
    target.addEventListener(eventName, handlerName, false);
} else if (target.attachEvent) {
    target.attachEvent("on" + eventName, handlerName);
} else {
    target["on" + eventName] = handlerName;
}
于 2012-11-02T07:47:18.063 に答える