好吧,经过一段时间的挠挠我的头,"嗯?" 试图找出为什么IE在加载我的一个加载了jQuery优点的页面时会直接崩溃,我把罪魁祸首缩小到这条线
$('div#questions').hide();
Run Code Online (Sandbox Code Playgroud)
当我说IE崩溃时,我的意思是它完全崩溃,试图做它的网页恢复废话失败.
我正在运行jQuery 1.4.2并使用IE 8(尚未测试任何其他版本)
我目前的解决方法是:
if ($.browser.msie) {
window.location = "http://www.mozilla.com/en-US/products/download.html";
}
Run Code Online (Sandbox Code Playgroud)
出于某种原因,我觉得我的IE用户对这个解决方案不会很满意.
有问题的div有很多内容,其他的div再次被隐藏和显示,所有这些都很好用,花花公子只有当巨型父div被隐藏时IE才会翻转并刺伤自己.
有没有人遇到这个或有任何可能的想法出错?
编辑:
一切都包含在$(document).ready(function(){})中; 我的代码都是内部的,所以我不能不幸地链接它.
编辑:发现IE 8崩溃代码
<ol class="actionHelp">
<li>List the tasks (or actions) that are involved in your pattern along the top (one per column)</li>
<li>Put the starting point in the first column and the ending point in the last column.</li>
<li>To fill in the middle, simply ask: "What happens next?" If only one thing ever happens next, then it should get 100%. If 70% of the time one thing happens next, and 30% of the time another thing happens next, then put 70 in one box and 30 in the other.</li>
<li>Each row should add up to 100%</li>
<li>The last row is the exit and should not have any percentages in it.</li>
</ol>
Run Code Online (Sandbox Code Playgroud)
我不知道为什么这会在IE中引起问题,但这里是CSS
.actionHelp {
margin: 0 0 0 20px;
}
.actionHelp li {
margin: 5px 0;
}
Run Code Online (Sandbox Code Playgroud)
使用无序列表而不是有序列表不会导致崩溃,但是一旦我将其切换回来,我再次遇到崩溃,这个元素不需要被订购我只是把它作为具有逻辑意义的步骤,我我还是想知道为什么这会吓到IE.
jQuery + IE +隐藏了一个ol元素= OMG IE FAIL吗?或者有解决方法吗?
它似乎受到任何列表样式的影响,列表样式不是none
你的问题显然不是div#questions它本身。您可以尝试删除(或注释掉)所有div#questions内容并一次添加每个元素,直到 IE 再次开始崩溃吗?
一旦找到罪魁祸首,就对该元素再次执行相同的操作,删除其所有内容并将每个元素添加回来,在每个元素之后进行测试。
继续这样做,直到找到问题的真正根源。我知道这是一种技术含量很低的解决方案,但通常也是最快的解决方案。