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.
What might be causing this error?
You can Click Here to view the site 🙂
Update:
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. In that file, you have:
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.Removing the
/* Safari */comment won’t fix that problem, as the/* Firefox */below it causes the same issue.EDIT: 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:
Compare this fiddle, which is a copy/paste of the site code in question (all
headtags and relevant html markup), with the corrected fiddle, in which thestyle.cssmarkup has been imported into the fiddle and the#navigation-menu-containerrule has been changed to the above code, and you’ll see that the fiddle page doesn’t crash.