Discuz7.2 IE9适配性写法 杜工彻底修复计划方案

日期:2021-01-20 类型:科技新闻 

关键词:在线网页制作,建网页,个人简介网页制作,简单网页,建立网页

状况:
1. IE9迅速发帖不自动跳转
2. IE9管理方法员解决帖子不成功
3. IE9登陆不自动跳转,必须手动式更新

缘故:

1. AJAXPOST涵数分辨out了
2. 动态性建立iframe时各访问器解决方法不一样

处理方式:

1. 改动templates/header.htm

<meta http-equiv=”x-ua-compatible” content=”ie=7″ />
更换为

拷贝编码
编码以下:

<!–[if lte IE 8]>
<meta http-equiv=”x-ua-compatible” content=”ie=7″ />
<![endif]–>
<!–[if IE 9]>
<meta http-equiv=”x-ua-compatible” content=”ie=9″ />
<![endif]–>


2.改动include/js/common.js

把ajaxpost涵数更换为:


拷贝编码
编码以下:

function ajaxpost(formid, showid, waitid, showidclass, submitbtn, recall) {
var waitid = typeof waitid == 'undefined' || waitid === null ? showid : (waitid !== '' ? waitid : '');
var showidclass = !showidclass ? '' : showidclass;
var ajaxframeid = 'ajaxframe';
var ajaxframe = $(ajaxframeid);
var formtarget = $(formid).target;
var handleResult = function() {
var s = '';
var evaled = false;
showloading('none');
try {
s = $(ajaxframeid).contentWindow.document.XMLDocument.text;
} catch(e) {
try {
s = $(ajaxframeid).contentWindow.document.documentElement.firstChild.wholeText;
} catch(e) {
try {
s = $(ajaxframeid).contentWindow.document.documentElement.firstChild.nodeValue;
} catch(e) {
s = '內部不正确,没法显示信息此內容';
}
}
}
if(s != '' && s.indexOf('ajaxerror') != ⑴) {
evalscript(s);
evaled = true;
}
if(showidclass) {
$(showid).className = showidclass;
if(submitbtn) {
submitbtn.disabled = false;
}
}
if(!evaled && (typeof ajaxerror == 'undefined' || !ajaxerror)) {
ajaxinnerhtml($(showid), s);
}
ajaxerror = null;
if($(formid)) $(formid).target = formtarget;
if(typeof recall == 'function') {
recall();
} else {
eval(recall);
}
if(!evaled) evalscript(s);
ajaxframe.loading = 0;
$('append_parent').removeChild(ajaxframe);
};
if(!ajaxframe) {
try{
ajaxframe = document.createElement('<iframe name="' + ajaxframeid + '" id="' + ajaxframeid + '"></iframe>');
}catch(e){
ajaxframe = document.createElement('iframe');
ajaxframe.name = ajaxframeid;
ajaxframe.id = ajaxframeid;
}
ajaxframe.style.display = 'none';
ajaxframe.loading = 1;
$('append_parent').appendChild(ajaxframe);
} else if(ajaxframe.loading) {
return false;
}
_attachEvent(ajaxframe, 'load', handleResult);
showloading();
$(formid).target = ajaxframeid;
$(formid).action += '&inajax=1';
$(formid).submit();
return false;
}


后台管理更新缓存文件,搞定。