首页 > Web开发 > 详细

A problem displaying [localhost] caused Internet Explorer to refresh the webpage using Compatibility

时间:2015-03-30 18:53:11      阅读:249      评论:0      收藏:0      [点我收藏+]

问题:

上周使用JQuery UI 的Dialog 实现弹出对话框后查询的功能,抛了如下错误:

“A problem displaying [localhost] caused Internet Explorer to refresh the webpage using Compatibility View.”

我用的IE8,FF,chrome测试的,只有IE8抛出这个问题。

技术分享


IE自动切换到Compatibility View 模式。弹出对话框后,无法操作,总会自动刷新页面。


解决过程:

对话框里的代码写在<div id="GroupSetting_Dialog" class="dialogContent">...</div>中

先把div里面的代码注释,运行,看有没有问题,如果没有问题,再慢慢减少div里注释的代码,再运行。如此反复进行几次后,发现是div里的一个小div有问题。

但这个小div里没有html,只有css,于是删掉css,运行没有问题,再把css一点点加上尝试,直到加上“"max-height:200px;”时,抛出了错误。

查了一下,说是IE8暂不支持max-height/min-height。

所以,就就用JS来给小div增加height属性。


解决方法:

IE8不支持某个CSS, 所以用JS来给div增加其他可替代的属性。

$("#ViewList").attr("style", "height:200px; overflow:scroll;");




A problem displaying [localhost] caused Internet Explorer to refresh the webpage using Compatibility

原文:http://blog.csdn.net/bubu05690523/article/details/44752003

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!