IE11怪癖模式和JQuery不工作
在我们测试所有应用程序之前,我们的系统人员已经将所有浏览器更新为IE11 我们的一个应用程序在IE11下无法正常运行,要使其正确呈现,唯一的方法是使其在quirks模式下运行(我相信现在它在IE11中模拟IE5?),但是该站点使用JQuery,如果它通过此模式呈现,尽管呈现正常,但功能不起作用,并且我们在加载页面时收到JQuery错误,例如,以下jquery函数(特别是在返回行上)出现“未找到成员”错误: 除了重新编写应用程序之外,有人有什么建议吗IE11怪癖模式和JQuery不工作,jquery,internet-explorer-11,quirks-mode,Jquery,Internet Explorer 11,Quirks Mode,在我们测试所有应用程序之前,我们的系统人员已经将所有浏览器更新为IE11 我们的一个应用程序在IE11下无法正常运行,要使其正确呈现,唯一的方法是使其在quirks模式下运行(我相信现在它在IE11中模拟IE5?),但是该站点使用JQuery,如果它通过此模式呈现,尽管呈现正常,但功能不起作用,并且我们在加载页面时收到JQuery错误,例如,以下jquery函数(特别是在返回行上)出现“未找到成员”错误: 除了重新编写应用程序之外,有人有什么建议吗 谢谢修复触发怪癖模式的html。@MarcB我
谢谢修复触发怪癖模式的html。@MarcB我认为OP的问题在于代码是为怪癖模式编写的,并导致新版本出现错误,而不是他不知道是什么触发了怪癖模式。您使用的是什么版本的jQuery?这段代码的具体用途是什么?
// IE6/7 do not support getting/setting some attributes with get/setAttribute
if ( !getSetAttribute ) {
fixSpecified = {
name: true,
id: true
};
// Use this for any attribute in IE6/7
// This fixes almost every IE6/7 issue
nodeHook = jQuery.valHooks.button = {
get: function( elem, name ) {
var ret;
ret = elem.getAttributeNode( name );
return ret && ( fixSpecified[ name ] ? ret.nodeValue !== "" : ret.specified ) ?
ret.nodeValue :
undefined;
},
set: function( elem, value, name ) {
// Set the existing or create a new attribute node
var ret = elem.getAttributeNode( name );
if ( !ret ) {
ret = document.createAttribute( name );
elem.setAttributeNode( ret );
}
return ( ret.nodeValue = value + "" );
}
};