“啊,啪!”检查Chrome中的元素时出错 [英] 'Aw, Snap!' Error when inspecting element in Chrome

查看:162
本文介绍了“啊,啪!”检查Chrome中的元素时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我检查我导航菜单中的任何元素,或者检查元素,然后浏览到导航菜单,我会在Google Chrome中获得Aw,Snap错误。我认为源码一定有问题,但在编辑器中查看源代码后,似乎格式一切正确。

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. 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.

可能导致此错误?

您可以点击此处查看网站:)

此代码中的某些内容导致错误:

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.

推荐答案

问题似乎是您的 style.css 文件。在该文件中,您有:

The problem appears to be an issue with your style.css file. In that file, you have:

/*::selection {
    background: #666; /* Safari */
    color: #FFF;
}

::-moz-selection {
    background: #666; /* Firefox */
    color: #FFF;
}*/

发生什么事是你有一个评论 / * Safari * / 在上述整个代码段的更广泛的评论中,这是过早关闭更广泛的评论,并导致CSS的解析错误。 Google Chrome正在堵塞格式不正确的CSS文件,导致Aw,snap!检查元素时发生错误。

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. Google Chrome is choking on the malformed CSS file, which is causing the "Aw, snap!" error to occur when inspecting elements.

删除 / * Safari * / 注释不会解决这个问题,因为 / * Firefox * / 下面会导致相同的问题。

Removing the /* Safari */ comment won't fix that problem, as the /* Firefox */ below it causes the same issue.

编辑:虽然这确实解决了CSS的一个小问题,但并不是整个解决方案。根据以下 thakis 的回答,修复以下风格可以防止在检查元素时崩溃:

While that did fix a minor issue with the CSS, it wasn't the whole solution. In light of thakis' answer below, fixing the following style does prevent the crashing when inspecting elements:

#navigation-menu-container{
  border-image:  url(images/shadow-border.png) 10 stretch;
}

比较这个小提琴,这是有问题的网站代码的复制/粘贴(全部 head 标签和相关的html标记),正确的小提琴,其中 style.css 标记已导入小提琴,#navigation-menu-container 规则已更改为上述代码,您会看到小提琴页面不会崩溃。

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.

这篇关于“啊,啪!”检查Chrome中的元素时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆