[英]'Aw, Snap!' Error when inspecting element in Chrome
Whenever I inspect any element that's part of my navigation menu, OR inspect element and then browse to a navigation menu I get the 'Aw, Snap' error in Google Chrome. 每当我检查导航菜单中的任何元素,或者检查元素然后浏览到导航菜单时,我会在Google Chrome中收到“Aw,Snap”错误。 I figured there must be something wrong with the source but after reviewing the source in an editor it seems as though everything is correct in format.
我认为源必须有问题,但在编辑器中查看源代码后,似乎一切都是正确的格式。
What might be causing this error? 可能导致此错误的原因是什么?
You can Click Here to view the site :) 你可以点击这里查看网站:)
Something in this code here is causing the error: 此代码中的某些内容导致错误:
<li>
<a id="nav-corporate" class="accordionButton <?php if (is_page(1635) || is_page(1909)) { echo "curr-page-nav";}?>">Corporate</a>
<div class="sub-list-container">
<ul>
<li>
<a href="<?php echo get_page_link(1635); ?>" id="nav-meeting" class="subitem"><span class="nav-hidden">Meetings</span></a>
</li>
<li>
<a href="<?php echo get_page_link(1909); ?>" id="nav-event" class="subitem"><span class="nav-hidden">Events</span></a>
</li>
</ul>
</div>
</li>
I have tried on three computers by the way. 顺便说一下,我试过三台电脑。
The problem appears to be an issue with your style.css file. 问题似乎是style.css文件的问题。 In that file, you have:
在该文件中,您有:
/*::selection {
background: #666; /* Safari */
color: #FFF;
}
::-moz-selection {
background: #666; /* Firefox */
color: #FFF;
}*/
What's happening is you have a comment /* Safari */
within a broader comment around the entire snippet above, which is closing the broader comment prematurely and causing a parse error for the CSS. 发生的事情是你在上面的整个片段的更广泛的评论中有一个评论
/* Safari */
,这会过早地关闭更广泛的评论并导致CSS的解析错误。 Google Chrome is choking on the malformed CSS file, which is causing the "Aw, snap!" 谷歌浏览器对格式错误的CSS文件感到窒息,导致“喔喔!” error to occur when inspecting elements.
检查元素时发生错误。
Removing the /* Safari */
comment won't fix that problem, as the /* Firefox */
below it causes the same issue. 删除
/* Safari */
comment不会解决这个问题,因为它下面的/* Firefox */
会导致同样的问题。
EDIT: While that did fix a minor issue with the CSS, it wasn't the whole solution. 编辑:虽然这确实解决了CSS的一个小问题,但它不是整个解决方案。 In light of thakis ' answer below, fixing the following style does prevent the crashing when inspecting elements:
根据下面的thakis回答,修复以下样式可以防止在检查元素时发生崩溃:
#navigation-menu-container{
border-image: url(images/shadow-border.png) 10 stretch;
}
Compare this fiddle , which is a copy/paste of the site code in question (all head
tags and relevant html markup), with the corrected fiddle , in which the style.css
markup has been imported into the fiddle and the #navigation-menu-container
rule has been changed to the above code, and you'll see that the fiddle page doesn't crash. 比较这个小提琴 ,它是有问题的网站代码(所有
head
标记和相关的html标记)的复制/粘贴,带有修正的小提琴 ,其中style.css
标记已导入小提琴和#navigation-menu-container
规则已更改为上面的代码,您将看到小提琴页面不会崩溃。
When chrome crashes, please file a bug at http://new.crbug.com so that the chrome developers can fix the problem. 当Chrome崩溃时,请在http://new.crbug.com上提交一个错误,以便Chrome开发人员可以解决问题。 (I've filed http://crbug.com/141139 for this issue for you).
(我已经为你提交了http://crbug.com/141139这个问题)。 Ideally, try making a copy of your site and keep removing things from the copy until you have a small test case that still reproduces the problem.
理想情况下,尝试制作您的网站的副本,并继续从副本中删除东西,直到您有一个仍然重现问题的小测试用例。 Then attach that to the bug.
然后将其附加到bug。
Edit: Looks like this bit from your style.css causes it: 编辑:看起来像你的style.css中的这一点导致它:
#navigation-menu-container{
border-image: url(images/shadow-border.png) stretch 10;
}
border-image
needs its numbers in front of stretch
(see eg http://css-tricks.com/understanding-border-image/ ), and Chrome gets confused by that not being the case. border-image
在stretch
前需要它的数字(参见例如http://css-tricks.com/understanding-border-image/),Chrome会因为不是这种情况而感到困惑。 Moving the 10
in front of stretch
fixes the crash (but the crash is still a chrome bug of course). 在
stretch
前移动10
stretch
修复崩溃(但崩溃仍然是一个铬虫当然)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.