简体   繁体   English

错误:TypeError:window.attachEvent不是函数

[英]Error: TypeError: window.attachEvent is not a function

I am using custome.js , PIE.js and jquery1_7_2.js file in my jsp 我在我的jsp使用了custome.jsPIE.jsjquery1_7_2.js文件

This is my custome.js and nothing more. 这是我的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);
        });
    }

});

})

everything working fine in all browser. 在所有浏览器中一切正常。 But in Firefox it is showing me this error 但在Firefox中,它向我显示了这个错误

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

Please guide me to solve this issue. 请指导我解决这个问题。

Edited: It showing me error in this line of PIE.js 编辑:它显示我在这行PIE.js中的错误

window.attachEvent("onunload",a);fKsa=function(b,c,d){b.attachEvent(c,d);this.ba(function(){b.detachEvent(c,d)})}})();f.Qa=new 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)})();(function(){function a(){c=f.kb.md()}function b(){if(c){for(var d=0,e=c.length;d window.attachEvent( “onunload的”,一个); fKsa =功能(B,C,d){b.attachEvent(C,d); this.ba(函数(){b.detachEvent(C,d)})} })(); f.Qa = new 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)})();(function(){function a(){c = f .kb.md()} function b(){if(c){for(var d = 0,e = c.length; d

and custome.js in this line custome.js在这一行

PIE.attach(this); PIE.attach(本);

When attaching events in order to make it cross browser perform the following: 附加事件以使其跨浏览器执行以下操作:

if (target.addEventListener) {
    target.addEventListener(eventName, handlerName, false);
} else if (target.attachEvent) {
    target.attachEvent("on" + eventName, handlerName);
} else {
    target["on" + eventName] = handlerName;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM