最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Browser Link JS error on page load - Stack Overflow

programmeradmin4浏览0评论

Using Visual Studio 2013 RTM and Web Essentials I get the following JavaScript error in Chrome on page load.

Uncaught Error: Syntax error, unrecognized expression: div.main/PhoneIcon.png

My best guess is that it is referring to the following line of html which is near the top of my page.

<div class="main/PhoneIcon.png sprite"></div>

I'm also not able to edit/modify HTML/CSS using Browser Link.

What do I need to do to fix Browser Link?

Using Visual Studio 2013 RTM and Web Essentials I get the following JavaScript error in Chrome on page load.

Uncaught Error: Syntax error, unrecognized expression: div.main/PhoneIcon.png

My best guess is that it is referring to the following line of html which is near the top of my page.

<div class="main/PhoneIcon.png sprite"></div>

I'm also not able to edit/modify HTML/CSS using Browser Link.

What do I need to do to fix Browser Link?

Share Improve this question edited Nov 1, 2013 at 18:30 Ryan Blatz asked Nov 1, 2013 at 17:55 Ryan BlatzRyan Blatz 711 silver badge3 bronze badges 2
  • 1 Your class name is invalid: stackoverflow./questions/448981/… – Tieson T. Commented Nov 1, 2013 at 17:58
  • 1 That only applies to css selectors. So any selector I would write for that class name would need to be escaped, but the actual html does not need to be escaped. stackoverflow./a/6732899/2344026 – Ryan Blatz Commented Nov 1, 2013 at 18:29
Add a ment  | 

2 Answers 2

Reset to default 12

Browser Link tried to create a jQuery selector that would uniquely identify this tag, but it didn't handle the unexpected class name correctly.

You can work around this by adding an ID to the tag. Browser Link would rather use an ID, because it's more likely to be unique. It will ignore the class name if there's a unique ID on the tag.

Or, if you just want Browser Link to get out of the way, you can disable it by unchecking "Enable Browser Link" in the Browser Link menu on the Standard toolbar.

This is a bug in Microsoft.VisualStudio.Web.PageInspector.Runtime.MappingData.MappingDataUtilities.GenerateSelectorsFromCssClasses() inside Visual Studio itself. It doesn't escape unusual classnames.

This has nothing to do with Web Essentials; it's a bug in the BrowserLink core.

发布评论

评论列表(0)

  1. 暂无评论