找到了问题的解决方法。通过修改ajax4jsf-1.1.0.jar来修复
根本原因:在 IE-8 的情况下,响应是从 Ajax 对象中获取的,尽管响应尚未读取。因此,我们通过检查 status==200 和 readystate=4 添加了 IE 修复。
这是我们所做的 打开 AJAX.js,它位于 jar 内的 \org\ajax4jsf\framework\ajax\scripts\AJAX.js 下
步骤 1. 更改:
getResponseText : function(){
return this._request.responseText;
}
至:
getResponseText : function(){
if (this._request.readyState == 4){
if (this._request.status == 200) {
return this._request.responseText;
}
}
}
STEP 2. 寻找这个方法并改变从:
window.setTimeout(function() {
var isDocOpen=false;
//This functions has few more lines , I have not pasted all code here...
改成:
//This is the Fix for IE....The isIE variable is pre defined inside the script.
if (isIE){
if (req.readyState == 4){
if (req.status == 200) {
window.document.open(req.getContentType(),true);
isDocOpen=true;
window.document.write(req.getResponseText());
window.document.close();
}
}
}
else {
//This is the Original code...
//Keep this for all other browsers...
window.document.open(req.getContentType(),true);
isDocOpen=true;
window.document.write(req.getResponseText());
window.document.close();
}
.. 其余代码应遵循原始脚本。
第 3 步:
//COMMENT OUT THIS ORIGINAL CODE. Not sure why this reloading is done for IE
//this was causing IE to send requests...more than once..
//if(isIE){
/ For Ie , scripts on page not activated.
// window.location.reload(false);
//}
完成上述更改后,我们使用 win rar 并将 Ajax.js 文件放回 ajax4jsf-1.1.0.jar,现在 IE 8 的问题得到解决。
希望它可以帮助那里的人。