Internet Explorer 11 gives script error in PageRequestManager.js

时间秒杀一切 提交于 2019-12-03 16:04:43

Try forcing the browser to render in IE 10 mode...

<meta http-equiv="X-UA-Compatible" content="IE=10" />

I got that problem with jQuery 1.10 and it seems, that IE11 lacks the support of "attachEvent" which is used in jQuery and which seemed to be used by your framework as well. There is a Microsoft bugticket for that: Bugticket attachEvent IE11

I've found a solution in the related jQuery bugticket. Just insert the following code before your framework:

var isIE11 = !!(navigator.userAgent.match(/Trident/) && !navigator.userAgent.match(/MSIE/)); 
if (isIE11) {
    if (typeof window.attachEvent == "undefined" || !window.attachEvent) {
        window.attachEvent = window.addEventListener;
    }
} 

You first check if the browser is IE11 and then bind the attachEvent listener again so the error doesn't occur again.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!