ComfortablyNumb ComfortablyNumb - 11 months ago 76
Javascript Question

Javascript Errors when Debugging in Visual Studio 2013

I've just opened up a website for the first time in VS2013 and I'm getting Javascript exceptions when I run debugger:

Unhandled exception at line 194, column 21 in http://localhost:49809/

0x800a1391 - JavaScript runtime error: '$' is undefined

And here's the code:

<script type="text/javascript">
$(function () {
width: '960px',
height: '250px',
speed: 400,
easing: 'easeOutSine'

Click Continue and I get a further exception:

Unhandled exception at line 37, column 59140 in http://localhost:52306/27fadf043d464a019907842c2a5a764e/browserLink

0x800a139e - JavaScript runtime error: Syntax error, unrecognized expression: unsupported pseudo: plusone

This website works fine live and debugs without issue in VS2012. I have a suspicion it's to do with referring to remote Javascript blocks (
<script src="//" type="text/javascript"></script>
<script type="text/javascript" src="//">
). Is there a permissions setting I need to amend?

Any help would be greatly appreciated.


Answer Source

It looks as though your script manager adds in the jquery reference in the body tag of a master page. You're putting in your own script and referencing jquery using the '$' symbol before the master page gets to the body tag.

Just move your own script to after the body. If you're using a content placeholder then move the content placeholder after the body (and not in the 'head' section).