Discuz7.2 IE9兼容性–杜工完全修补方案0+

10,310 views / 2011.04.22 / 6:06 下午
现象:
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') != -1) {
 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;
}
后台刷新缓存,搞定。
Categories: 感悟 Tags: ,

CentOS或者redhad下用yum或者rpm安装了 mysql 及 mysql-server , 在编译安装php时用 –with-mysql 选项出现错误

Note that the MySQL client library is not bundled anymore.

首先使用命令find / -name ‘mysql.h’ 查找路径,如果找到就给with-mysql=赋上路径,如果找不到,那就是缺少了 mysql-devel 安装包,用yum或者rpm安装上,即可解决问题

Categories: 感悟 Tags: ,