2

I'm having some difficulty with what seems to be the simplest of operations.

In visual studio, when I change vsDoc from 1.4.1 to 1.5, javascript on the page no longer works. (Visual Studio 2010)

The original (that works) is like this:

<head runat="server">
<title></title>
<link type="text/css" href="css/excite-bike/jquery-ui-1.8.11.custom.css" rel="stylesheet" />

<script src="Scripts/jquery-1.5.1.min.js" type="text/javascript"></script>
<script src="Scripts/jquery-1.4.1-vsdoc.js" type="text/javascript"></script>
<script src="Scripts/jquery-ui-1.8.11.custom.min.js" type="text/javascript"></script>

And everything is fine, intellisense is fine, javascript is fine. Everything is good to go.

However, when I reference the newer vsDoc file (obtained from ajax.aspnetcdn.com )

<head runat="server">
<title></title>
<link type="text/css" href="css/excite-bike/jquery-ui-1.8.11.custom.css" rel="stylesheet" />    

<script src="Scripts/jquery-1.5.1.min.js" type="text/javascript"></script>
<script src="Scripts/jquery-1.5-vsdoc.js" type="text/javascript"></script>
<script src="Scripts/jquery-ui-1.8.11.custom.min.js" type="text/javascript"></script>

The page doesn't load properly and firebug shows the following errors:

class2type is not defined
rootjQuery is not defined

Both errors are apparently stemming from the vsdoc file line 67

I feel like I'm missing something terribly obvious and I hope someone can fill me in.

Thanks!

1 Answer 1

13

The -vsdoc is not intended to be included in your actual page, just in the files you need intellisense in. For your use, just rename:

 Scripts/jquery-1.5-vsdoc.js

to

 Scripts/jquery-1.5.1-vsdoc.js

and then remove that -vsdoc.js <script> block from the page. Visual studio will automatically search for the -vsdoc.js of any local JavaScript file you're including default. It need not be included in the page explicitly...that'll actually lead to issues like you're seeing, since it defines the same empty functions (and not all the needed variables).

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks for the help. Frankly I have no idea how I got the idea that I needed to directly reference the vsdoc file. I just now went and re-read the Scott Gu blog post about vsdoc in vsstudio 2008 and clearly I was just reading sentences that just don't exist! :) I'm going to go ahead and blame my mistake on working at 6am on a Sunday. Thanks again!
But why he got this problem only with new vsdoc file? and I didn't get what the change 1.5 to 1.5.1 should do. Can you explain it to me please?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.