Welcome to MSDN Blogs Sign in | Join | Help

Visual Web Developer Team Blog

Your official information source from the Visual Web Developer team.

News

  • These postings are provided "AS IS" with no warranties, and confer no rights. Use of included code samples are subject to the terms specified Terms of Use
Rich IntelliSense for jQuery

Update: A new Hotfix is availble to complement this file.

A while back we updated VS2008 IntelliSense to not fail when referencing jQuery.  However, getting IntelliSense for chained calls and rich summary/parameter hints still required adding special comments to a few thousand lines of jQuery.  If you didn't have the time, you could download such a file from friendly members of the community such as James and Brennan.

As part of our new partnership with jQuery, yesterday we announced the availability of the official IntelliSense documentation file.  As you can see, our friends at jQuery have added a new download link for Visual Studio at http://docs.jquery.com/Downloading_jQuery#Download_jQuery.

image

You can also download the file directly from http://code.jquery.com/jquery-1.2.6-vsdoc.js.  As you might guess, this documentation file corresponds with the latest version of jQuery (which is currently 1.2.6).  While this file has a "js" extension, it's really just a documentation file.  You do not want to run this file in the browser.

How do I use this file (today)?

If you're inside an ASPX page, you will need to add the following lines of code into (normally) the head of your page:

image

Why do we have a server-side conditional statement?  IntelliSense disregards conditional statements of this type, and thus loads the "vsdoc" file (overriding the normal one).  At runtime the if (false) statement will ensure it this documentation file is not rendered (and executed) as script.  This trick allows the "switching" behavior you want.

If you're in a JavaScript file, use the normal file reference syntax to refer to the "vsdoc" file.

image

There's no need for tricks here since this comment is only meaningful to IntelliSense.

How do I use this file (in the near future)?

The ideal user experience should be one where you do not need special tricks as mentioned above.  Really, you shouldn't need to mention the "vsdoc" file name at all.  To that end, we plan on releasing a Hotfix that will enable this (stay tuned!).  Given normal references such as...

image image

...IntelliSense will opportunistically search for "jquery-1.2.6-vsdoc.js" and load that file instead.  Generally, given script name "x", IntelliSense will opportunistically search for "x-vsdoc.js".  If not found, it will then search for "x.debug.js".  You just need to make sure to place your "vsdoc" file next to the normal file.  Note, if you use jquery-1.2.6.min.js, you may need to rename the file to match the search pattern.

What are the advantages of this file?

One unique benefit of the file we have released is that it supports and understands jQuery plug-ins.  For example, given the plug-in below...

image

...you would see "myplugin" show up in IntelliSense.

image

We've noticed a few plug-ins do not work, and commonly this is because there is an IntelliSense incompatibility issue with the plug-in itself (as opposed to the jQuery documentation file).

Hope this helps!

Jeff King
Program Manager
Visual Studio Web Tools

Posted: Tuesday, October 28, 2008 7:30 PM by WebDevTools

Comments

Shail said:

Hello Jeff,

I have downloaded the scripts and the documentation file as described above. Then I created test projects in VS 2005 and VS 2008. Here are my observations -

1. In VS 2005, I am getting no intellisense. I tried everything.

2. In VS 2008, I am getting intellisense. Also I have attached the jQuery files in my master page and that enabled the jQuery intellisense everywhere in my web site.

Any idea what I need to do with VS 2005. We are still using VS 2005.

Thanks,

Shail

# October 29, 2008 5:39 AM

WebDevTools said:

Hi Shail: I'm afraid VS2005 will not be able to support jQuery IntelliSense.  There were major changes made in VS2008 to enable the new functionality, and thus it's not something we can easily add to previous versions.

# October 29, 2008 6:17 AM

Mark Henderson said:

Hi Jeff,

This sounds great, and I want to use it immediately...

The thing that confuses me is do I need to remove the conditional statement before making a webpage live, or is it ok to have it run in a live environment?

You say: 'You do not want to run this file in the browser.'

I know this is temporary, but with how I have my sites setup I wouldn't want to add this line and then remove it before publishing all the time?!?

Many thanks,

Mark

# October 29, 2008 8:54 AM

Kumar said:

What if I use MasterPage then in order to use intellisense in content page I have to put in content page or it can reference from master file also? (I have tons of content pages)

# October 29, 2008 10:04 AM

Shail said:

Hello Kumar,

Yes, if you are using VS 2008. You can place script references as mentioned above, you will get intellisense in all your content page. You do not need to put any in content page. Placing reference in MasterPage is enough.

Shail

# October 29, 2008 10:39 AM

Shail said:

Just one more thing,

if you try to put that "<% if ( false ) %>" in header of your master page ( Because you want intellisense  in all your content pages ), you will get error  -

"The Controls collection cannot be modified because the control contains code blocks <% ... %>..."

Reason, your header is marked as runat="server". You can not remove that, themes won't work then

You can fix that by moving that code block in the body of MasterPage, just after the form tag ( That is my case ). And now you will get intellisense in all your content pages.

Shail

# October 29, 2008 11:07 AM

Visual Studio Hacks said:

My latest in a series of the weekly, or more often, summary of interesting links I come across related to Visual Studio. The Web Developer Team announced that the official IntelliSence documentation file, which provides Rich IntelliSense for jQuery ,

# October 29, 2008 4:06 PM

jquery said:

How does it understand jQuery plug-ins? What makes a plug-in incompatible vs compatible for IntelliSense?

# October 30, 2008 9:31 AM

CurlyFro said:

is there anyway to add this reference file to the web.config so it's global to Visual Studio?

# October 30, 2008 4:11 PM

Bob Reader said:

The intellisense does not seem to work in a <script> element in a user control.  Is there a way to get this working?

# October 30, 2008 6:06 PM

Bob Reader said:

Above, I meant to say, if you put the vsdoc reference in the master page, the intelliense does not work in a <script> element in a user control.  

# October 30, 2008 6:12 PM

Shail said:

Hi CurlyFro,

I don't think so that currently there is any option to specify a script reference in web.config.

Actually the Instellisense is something required at design time. There should be something like this - You can add a documentation file ( like one of jQuery ) to "Intellisense files" section of VS and that's all.

May be we need to wait for next version of ASP.Net. May be the ASP.Net is working on this.

Shail

# October 31, 2008 6:53 AM

Shail said:

Hello "Bob Reader",

That is because a "Web User Control" can not use a MasterPage. MasterPage make sense with Pages. So the intellisense will not be available.

I think, the best possible solution is to add the "<% if ( false ... %>"  code to your (I named it "jQueryIntellisense")in VS ToolBox ( Clip Board ??) and drag and drop to your UserControl when required. This will just save your time. I am using this manual hack for my UserControls

Shail

# October 31, 2008 7:01 AM

DotNetKicks.com said:

You've been kicked (a good thing) - Trackback from DotNetKicks.com

# November 1, 2008 7:33 AM

RasmusKL's Blog said:

Simple ASP.NET MVC Beta AJAX with jQuery!

# November 5, 2008 3:23 PM

ASPInsiders said:

It looks like many of you have already noticed that there's an official Visual Studio autocomplete file

# November 6, 2008 2:14 AM

ScottGu's Blog said:

Last week was our big PDC conference, and I've been busy catching up back at work this week.&#160; I

# November 6, 2008 3:34 AM

BusinessRx Reading List said:

Last week was our big PDC conference, and I've been busy catching up back at work this week.&#160; I'm

# November 6, 2008 4:06 AM

Duncan Smart said:

FYI: Wrap it in a <asp:Literal runat="server" Visible="false"> if you want it to work in Master Pages or other places where inline code blocks aren't supported.

# November 6, 2008 8:04 AM

Official BV Software Blog said:

JQuery Intellisense in Visual Studio 2008 - Tip if it's not working in MVC

# November 6, 2008 11:53 AM

Marcus McConnell said:

In MVC projects jQuery intellisense doesn't show up if I reference the script files with an absolute root path like "/scripts/jquery-1.2.6-vsdoc.js". However, if I reference it with the tilda relative root it does work "~/scripts/jquery-1.2.6-vsdoc.js"

# November 6, 2008 11:56 AM

Patrick said:

I'm having the same problem than Marcus except the tilda trick doesn't even work for me.

Actually I'm only getting intellisense for standard js functions and my local functions.

I don't get any intellisense for Ajax either.

I'm using the standard MVC template and am declaring my scripts in my master page as follows:

<script src="../../Scripts/jquery-1.2.6.js" type="text/javascript"></script>

   <% if (false) { %>

       <script src="../../Scripts/jquery-1.2.6-vsdoc.js" type="text/javascript"></script>

   <% } %>

   <script src="../../Scripts/jquery.color.js" type="text/javascript"></script>    

   <script src="../../Scripts/MicrosoftAjax.js" type="text/javascript"></script>

   <script src="../../Scripts/MicrosoftMvcAjax.js" type="text/javascript"></script>

</head>

Any idea?

# November 6, 2008 1:20 PM

Shannon said:

So I'm using the Google provided method of including jQuery in my pages:

<script type="text/javascript" src="http://www.google.com/jsapi"></script>

<script type="text/javascript">google.load("jquery", "1");</script>

At the moment I am just specifying the latest major version of jQuery to include which just happens to be 1.2.6.

[quote]

Generally, given script name "x", IntelliSense will opportunistically search for "x-vsdoc.js".

[/quote]

So given that I am not referencing jquery-1.2.6.js, I take it there will be no IntelliSense support when including jQuery with the Google provided method?

# November 6, 2008 3:17 PM

Guido said:

I have all my js in an external js file. Is there any way I can take advantage of this with an external js file?

I assume no, in any case great work this is a good thing.

# November 6, 2008 4:06 PM

thrashy said:

Patrick:

Check to see if you have SP1 installed. I had the same issue with jQuery. I thought I installed it on my work machine but forgot about it. Once I did intellisense started working.

# November 6, 2008 4:47 PM

smallworkarounds said:

Here is a small post on Jquery which is a far better alternative to Aspnet Ajax.Its a small JavaScript

# November 6, 2008 10:52 PM

T2噬菌体 said:

本文文源来自ScottGu's Blog,我将其中的内容摘录并翻译。文章内容是近期精彩博文推荐,内容涵盖ASP.NET AJAX, jQuery, ASP.NET MVC及Silverlight。相信其中很多文章对您非常有用。

# November 6, 2008 11:20 PM

Programming said:

Last week was our big PDC conference, and I&#39;ve been busy catching up back at work this week.&#160;

# November 7, 2008 3:16 AM

Visual Web Developer Team Blog said:

Last week I mentioned we would be releasing a Hotfix to accompany our new jQuery VSDoc file . This Hotfix

# November 7, 2008 8:45 PM

Community Blogs said:

Jeff King just announced the release of a patch for Visual Studio 2008 that enables the IDE to find the

# November 8, 2008 1:17 AM

Bill Beckelman said:

How to Use Visual Studio jQuery IntelliSense Supported Through Hotfix

# November 8, 2008 12:14 PM

Think with .Net said:

Visual Studio 2008 Hotfix for jQuery IntelliSense

# November 10, 2008 1:52 AM

Stephen said:

Much like before this "update" recommended above, i am getting the "warning" in VS2008 of

Error updating JScript IntelliSense: C:\Projects\Website\ScriptLibrary\jQuery\1.2.6\jquery.vsdoc.js: 'childNodes' is null or not an object @ 1571:4

and this is seemingly preventing Intellisense from working at all

does this for the "stock" version of jQuery as well....

rendering all this updating and excitement absolutely useless for me

# November 10, 2008 10:44 AM

Stephen said:

I forgot to mention, line 1571 in the "vsdoc" file is a blank line, so studio has absolutely zero clue what's going on

# November 10, 2008 10:45 AM

Alex Gavrilov [MSFT] said:

Stephen,

I noticed in the error message the name of the file is "jquery.vsdoc.js". The standard file we provide is "jsquery-vsdoc.js". There is a "-" instead of a "." in front of "vsdoc".

Also, would you please let us know how exactly you include the file?

Finally, would you please confirm that you have SP1 installed?

Thanks,

Alex

# November 10, 2008 11:51 AM

Tim Gaunt said:

This is great but I've noticed that it doesn't pick up on absolute URLs so if you have:

<script type="text/javascript" src="/js/jquery.js"></script>

It won't relate it to the file located in ../js/

Had me going for a while.

Tim

# November 10, 2008 2:42 PM

Jm said:

I am having same problem, I install SP1 today, later the hotfix, I try this forms for using the file:

<script type="text/javascript" src="/scripts/jquery.js"></script>

<script type="text/javascript" src="~/scripts/jquery.js"></script>

<script type="text/javascript" src="/scripts/jquery.vsdoc.js"></script>

<script type="text/javascript" src="/scripts/jquery-vsdoc.js"></script>

and never get intellisense work :(

Always say problem with js Intellisense.

Best regards.

# November 10, 2008 3:19 PM

Alex Gavrilov [MSFT] said:

Absolute URL won't work for IntelliSense purposes. This is because absolute URL is resolved against the location where your application is deployed at runtime. There is no way for Visual Studio at design-time know how to resolve "/foo/file.js" - this starts at the server root, not project root.

App-relative URL doesn't work in <script> tag because it is ASP.NET control server-side syntax, it is not standard HTML. That's why you cannot use "~/foo/file.js" inside of a <script> tag. It would work fine inside of a Script Manager control, such as

<asp:ScriptManager id="sm1" runat="server>

   <asp:ScriptReference path="~/foo/file.js" />

</asp:ScriptManager>

For IntelliSense purposes, you can use relative URLs, such as "../foo/file.js"

# November 10, 2008 5:12 PM

JM said:

oh, thx, I can take some intellisense using only  <script type="text/javascript" src="scripts/jquery.js"></script> I get some methods, but $('div'). or $('#mydiv'). dont show me anything :(

# November 10, 2008 6:03 PM

Alex Gavrilov [MSFT] said:

Hi JM,

Are you using Visual Studio 2008 SP1? Do you have jquery-vsdoc.js file in your project at the same location as jquery.js?

Thanks,

Alex

# November 10, 2008 7:41 PM

JM said:

yeah, I just installed sp1 today, and later the hotfix. I try using the -vsdoc.js file directly, but I can't get intellisense working ok.

best regards

# November 10, 2008 7:58 PM

Brian Caputo said:

I can't get intellisense to work if I have more than one .js file.  

For instance in my head if I only have <script src="Support/jquery-1.2.6.js" type="text/javascript"></script> intellisense works fine.  But once I add other files such as <script src="Support/jquery.ui.all.js" type="text/javascript"></script> I lose intellisense.  I noticed that ui doesn't contain the intellisense markup - but does that mean if I want to use a plugin I have to go without intellisense?

# November 11, 2008 5:11 AM

Stephen said:

@Alex:

"I noticed in the error message the name of the file is "jquery.vsdoc.js". The standard file we provide is "jsquery-vsdoc.js". There is a "-" instead of a "." in front of "vsdoc"."

Yeah, i changed my file name to match my other js file naming convention....  none the less, it didn't work with the regualar file name anyways

"Also, would you please let us know how exactly you include the file?"

Inside my master page's <head runat="server"> section

<script src="/ScriptLibrary/jQuery/1.2.6/jquery.js" type="text/javascript"></script>

<asp:Literal ID="ScriptsToReference" Visible="false" runat="server">

   <script src="../../ScriptLibrary/jQuery/1.2.6/jquery.vsdoc.js" type="text/javascript"></script>

</asp:Literal>

"Finally, would you please confirm that you have SP1 installed?"

It is indeed installed along with the linked "hotfix" in this blogpost

Thanks,

Alex

# November 11, 2008 10:52 AM

Alex Gavrilov [MSFT] said:

Stephen,

You need to change the path in the <script src="..." />. I already explained this a couple of posts above, but let me try again since this issue keeps coming up.

Absolute URLs don't work at design-time for JScript IntelliSense. In your case, your URL is server-relative. Basically, you are saying "my script is in the /ScriptLibrary folder that is at the root of my web server". However, your application won't necessarily be deployed to the root of your web server. It can be deployed to any subfolder of your web server.

There is no way for Visual Studio to know at design time where your application will be deployed at run-time. If Visual Studio were to make the assumption that the application will be deployed to the root of the web server and resolve the /ScriptLibrary folder as being at the root of the project, than it may give you a false sense of security. If you were to deploy the project in a subfolder of your web server root (e.g., http://www.myserver.com/myapplication/ScriptLibrary"), your code wouldn't work at runtime even though intellisense would work at design-time. We had a number of complaints from the users that when IntelliSense works, they assume they are doing everything correctly, but then at runtime things don't work, and they have hard time understanding why.

I hope the implementation makes sense. Meanwhile, to fix the issue, you can use document-relative URL or absolute URLs that include server name. E.g., if your document is in folder "subfolder/mydocument.aspx", and your scrits are in folder "ScriptLibrary" relative to the root of your project, then in "mydocument.aspx" you would use

<script src="../ScriptLibrary/jquery.js" />

That is a safe practice in general, because your paths will always resolve at runtime regardless of whether your app is deployed at the root of your web server or in a virtual directory/subfolder of your web server. IntelliSense will work in that case. Or else you can use ScriptManager control and app-relative URL (see example in my post above).

Thanks,

Alex

# November 11, 2008 2:27 PM

Alex Gavrilov [MSFT] said:

Brian,

Unfortunately, we do not currently support all jQuery plug-ins. Some work, some do not work yet. As a temporary workaround, would you please try these suggestions?

Thanks,

Alex

http://blogs.msdn.com/webdevtools/archive/2008/11/07/hotfix-to-enable-vsdoc-js-intellisense-doc-files-is-now-available.aspx#9054488

# November 11, 2008 2:55 PM

Alex Gavrilov [MSFT] said:

Hi JM,

Do you have your website online somewhere so that I can take a look at the HTML source? And/or could you please paste the exact way your include jQuery and other JS files you are using in your page?

Also, would you please take a look at this

http://blogs.msdn.com/webdevtools/archive/2008/11/07/hotfix-to-enable-vsdoc-js-intellisense-doc-files-is-now-available.aspx#9054488

and see if that solves your issue?

Thanks

Alex

# November 11, 2008 3:00 PM

Stephen said:

"Absolute URLs don't work at design-time for JScript IntelliSense."

Then this excitement/work-to-make this happen is 100% useless

"I hope the implementation makes sense"

No, no it doesn't..... if i had the following structure

C:\Projects

  - MyProject

      - MyMaster.Master

      - Default.master

      - Contact.aspx

      - Reports.aspx

      - Users.aspx

Then great, it makes sense, but lets look at reality....  web applications can get big, few hundred pages big....

and the structure

Design (Folder)

  - MyMaster.Master

- Reports (Folder)

  - Bought.aspx

  - Sold.aspx

- Manage (Folder)

  - Users (Folder)

     - List.aspx

     - Add.aspx

  - Clients (Folder)

     - List.aspx

     - Add.aspx

  - Default.aspx

- Scripts (Folder)

  - jQuery

     - jquery.js

     - jquery-vsdoc.js

- Default.aspx

Which I am sure is more "real life" than all aspx files in one folder to better organize common functionality

Whatever though... the VS team thinks the first scenario is the way people program, then so be it, but they should get more feedback from real programmers out there writing real world applications...

and with the code

<script src="/ScriptLibrary/jQuery/1.2.6/jquery.js" type="text/javascript"></script>

<asp:Literal ID="ScriptsToReference" Visible="false" runat="server">

  <script src="../../ScriptLibrary/jQuery/1.2.6/jquery-1.2.6-vsdoc.js" type="text/javascript"></script>

</asp:Literal>

Shouldn't studio ignore the first <script> (which is the *only* way that the script gets included if i am 0 to n folders deep in my application), and pick up the second "fake" reference, and as a result give me Intellisense, that is in relation to the location of the Master page?

I mean look, I am a Microsoft developer, have been for almost 9 years now, but time and time again over that time after going to 5 to 6 DevConnections and jumping into the latest and greatest every time:  it seems like all this "gee wiz" stuff that comes out is absolutely useless in real world applications.....

# November 11, 2008 10:36 PM

Alex Gavrilov [MSFT] said:

Hi Stephen,

I guess I am not sure what you mean. The relative URLs can be used in a web site of any complexity with any folder structure. It is fine to use them in master pages. You do not need to use to different URLs (.js and -vsdoc.js) if you install the QFE that Jeff mentions in his post.

To help me explain this, I created a web site that uses a master page and roughly follows the structure you outlined (including multiple folders with subfolders, master page, script library folder, etc.). Would you please take a look at

http://cid-a02828f5daafb84a.skydrive.live.com/self.aspx/WebSiteSamples/ExampleSite.zip

and explain to me if this somehow doesn't work for you.

Thanks,

Alex

# November 12, 2008 5:55 AM

Justin's Blog said:

VS2008 SP1 Hotfix to Support -vsdoc.js IntelliSense Doc Files

# November 12, 2008 10:50 AM

Stephen said:

"Would you please take a look at"

And it doesn't work  :-(

Your MyMaster.master is this

http://paste.pocoo.org/show/90995/

Which the <script> tag for the jQuery file says:

- go up one folder (which is the project root)

- Go into "ScriptLibrary" folder

- Go into "jQuery" folder

- Get "jquery-1.2.6.js" (or the vsdoc version)

So that's fine, *from the master page's point of view*

Pulling up "Manage/Users/Add.aspx" is a fat ol 404 error for the JavaScript reference, as it's generated HTML is:

<script src="../ScriptLibrary/jQuery/jquery-1.2.6.js" type="text/javascript"></script>

Which says:

- Go up a folder (Which in this case is *not* the root but rather "Manage")

- And then go a folder down into "ScriptLibrary" (which doesn't work since we aren't on the root!)

That make sense why it doesn't work?

# November 12, 2008 4:18 PM

Nathan said:

Hi, first I want to say that the js intellisense is great.  If it wasn't I wouldn't have tried so hard to make it work.  

Here's how I did:

1. Read above article

2,3,4... Discover which js files are confusing intellisense, have your error list visible to show warnings (note that I noticed the jquery file to be fine (the vs doc one) but when sometimes ui core and some ui plugins usually will break intellisense (but the error will mention the jquery file, not the file which is actually problematic).  

Close any files in Visual studio you are not using

for the aspx file, comment out all references to js files.  

Go to the js file you are writing and want intellisense for :

comment out all the references by removing all triple slashes (use 2 slashes) and don't leave the word "reference" intact.  

One by one, (taking great care to use relative urls as in this article) reference another single js for intellisense purposes, pressing save and checking for errors (as a warning), and testing intellisense (CTRL + Space (or your completion shortcut) to see a list including non window object stuff like a $ for jquery etc)

Once intellisense is broken again by adding a file, comment them all out to get intellisense to work again, then add them one by one, but stop before the first one to cause problems.  

?!?

You might be thinking, hey, now all the scripts are commented out in the aspx, and you are right, this is a pain.  

to get around this, add the scripts here in such a way as for intellisense not to see them, like using an absolute reference.

(This absolute reference use is a pain for us since we will have to change that part before checking code in for other developers to use, building for deployment to different test servers or release by installer!)

I haven't tried the hotfix (I don't want to break my VS installation), but it sounds like it doesn't fix the bug, but rather makes it more convienient to include different versions for documentation.

Maybee it could help however, what if one were to make a -vsdoc.js file for each of the problematic js files which could be a blank file to stop breaking intellisense for everything else.  

# November 13, 2008 8:20 PM

WebDevTools said:

@Guido

If you want to get jQuery (or general rich IntelliSense) in an external file, you will need to use the /// <reference> tag.  See my post here for more details: http://blogs.msdn.com/webdevtools/archive/2007/11/06/jscript-intellisense-a-reference-for-the-reference-tag.aspx.  Note, this approach fully supports the VSDOC format as I describe here: http://blogs.msdn.com/webdevtools/archive/2008/11/07/hotfix-to-enable-vsdoc-js-intellisense-doc-files-is-now-available.aspx.  Thanks for reading!

# November 13, 2008 9:05 PM

WebDevTools said:

@Stephen

This is Jeff, and I work with Alex on the same team.  I see what you're saying but, I'm not sure if you're asking us to assume absolute paths resolve to the project root.  Since this list of 52 comments is quickly becoming unreadable, feel free to email me at jking at microsoft dot com.  I'd love to hear from you. Thanks!

# November 14, 2008 10:04 PM

ScottGu's Blog said:

Last month I blogged about how Microsoft is extending support for jQuery .&#160; Over the last few weeks

# November 21, 2008 5:07 AM

BusinessRx Reading List said:

Last month I blogged about how Microsoft is extending support for jQuery .&#160; Over the last few weeks

# November 21, 2008 5:41 AM

Kai.Ma said:

【原文地址】jQueryIntellisenseinVS2008【原文发表日期】Friday,November21,20082:07AM

上个月,我在博客里宣布了微软...

# November 23, 2008 3:12 AM

Nathan said:

Hi, found a more elegant solution to allow the javascript intellisense to work for those files which don't crash intellisense, while still including at runtime those which do.  

This time it avoids the use of absolute referenced URLs to js files.  

Now in the ASPX it looks something like

   <% if (false) {%>

       <script src="js/jquery/jquery-1.2.6-vsdoc.js" type="text/javascript" />

   <% } %>

   <asp:ScriptManager ID="ScriptManager1" runat="server">

       <Scripts>

           <asp:ScriptReference Path="~/js/v1/MyUtil1.js" />    

           <asp:ScriptReference Path="~/js/jquery/jquery-1.2.6.min.js" />

           <asp:ScriptReference Path="~/js/jquery/jquery-jtemplates.js" />

<%--  do not include here, breaks intellisense

           <asp:ScriptReference Path="~/js/jquery/ui/minified/ui.core.min.js" />

           <asp:ScriptReference Path="~/js/jquery/ui/minified/ui.datepicker.min.js" />

           <asp:ScriptReference Path="~/js/jquery/bgiframe-2.1/jquery.bgiframe.pack.js" />

           <asp:ScriptReference Path="~/js/jquery/jquery.clockpick.1.2.4/jquery.clockpick.1.2.4.min.js" />

           <asp:ScriptReference Path="~/js/p1/QuickTasksActions.js" />--%>

       </Scripts>

   </asp:ScriptManager>

<%=string.Concat(

          "<script src=\"js/jquery/ui/minified/ui.core.min.js\"  type=\"text/javascript\" ></script> \n",

          "<script src=\"js/jquery/ui/minified/ui.datepicker.min.js\"  type=\"text/javascript\"  ></script> \n",

          "<script src=\"js/jquery/bgiframe-2.1/jquery.bgiframe.pack.js\"  type=\"text/javascript\" ></script> \n",

          "<script src=\"js/jquery/jquery.clockpick.1.2.4/jquery.clockpick.1.2.4.min.js\" type=\"text/javascript\" ></script> \n",

          "<script src=\"js/p1/myPage.js\"  type=\"text/javascript\"  ></script> \n"

          ) %>

Note that the script declarations end in "></script>" with a newline, this is important, because if they end in /> in the same tag it will not work.  

The external js file has something like this at the top

/// <reference name="MicrosoftAjax.js"/>

/// <reference path="../v1/MyUtil1.js" />

/// <reference path="../jquery/jquery-1.2.6-vsdoc.js" />

/// <reference path="../js/jquery/jquery-jtemplates.js" />

// < r eference path="~/js/jquery/ui/ui.core.js" />

// < never r eference this one (breaks intellisense) r eference path="~/js/jquery/ui/ui.datepicker.js" />

// < never r eference this one (breaks intellisense) r eference path="~/js/jquery/jquery.clockpick.1.2.4/jquery.clockpick.1.2.4.js" />

This seems to do the trick for getting intellisense to work, but still doesn't stop visual studio from crashing and restarting from time to time, but especially when within a function called by the jquery method which is called when the dom document is ready.  

Hope this helps.

# November 23, 2008 7:58 PM

binglingshui said:

[转自MSDN]

在VS2008中启用jQueryIntellisense的步骤

要在VS中启用jQuery的intellisense完成,你要遵循三个步骤:

第一步:安装VS2008...

# November 24, 2008 3:29 AM

小角色 said:

【原文地址】jQuery Intellisense in VS 2008 【原文发表日期】 Friday, November 21, 2008 2:07 AM 上个月,我在博客里宣布了微软将对jQuery提供支持。在过去的几个星期里,我们与jQuery开发团队合作,在Studio 2008 和 Visual Web Developer 2008 Express版本(免费的)中增加了很好的jQuery intellisense支持。现在这个支持可以下载使用了。 在VS 2008中启用jQuery Intellisense的步骤

# November 24, 2008 9:13 PM

Felix Wang | Evangelizing the Next Web said:

【原文地址】 jQuery Intellisense in VS 2008 | VS 2008中的jQuery Intellisense 【原文发表日期】 Friday, November 21, 2008

# November 27, 2008 12:33 AM

David Murdoch said:

If it is not working for you in your external js files and you've tried adding a tilde (~) make sure you use BACKslashes in the documentation location.

ie: /// <reference path="~\js\jquery-vsdoc.js"/>

# December 2, 2008 12:21 PM

ScottGu's Blog em Português said:

Mês passado eu postei sobre como a Microsoft está estendendo o suporte à jQuery . Nas últimas semanas

# December 3, 2008 10:12 PM

不懂.NET said:

jQuery Intellisense in VS 2008 转自:http://weblogs.asp.net/scottgu/ Last month I blogged about how Microsoft is extending support for jQuery. Over the last few weeks we've been working with the jQuery team to add great jQuery intellisense support within

# December 15, 2008 12:09 AM

BorisZ said:

JQuery framework является одним из самых быстрых, удобных и простых для изучения. В данной статье будут

# December 30, 2008 2:39 AM

The Mighty Blog said:

&lt;p&gt;jQuery has had a pretty significant release since DotNetNuke 5 was released.&amp;#160; If you want to upgrade jQuery now, here's how...&lt;/p&gt; ...

# February 2, 2009 12:58 AM

The Menace .NET Blog said:

I’ve been reading a lot about jQuery lately (actually since last month) but more so lately because I

# February 16, 2009 6:24 AM

Sample Weblog said:

【原文地址】 ASP.NET MVC 1.0 Release Candidate Now Available 【原文发表日期】 Tuesday, January 27, 2009 12:13 PM 今天

# February 19, 2009 11:14 PM

Visual Web Developer Team Blog said:

jQuery 1.3 was released a little over a month ago. The 1.3 release adds exciting features such as selector

# February 24, 2009 8:39 PM

Somasegar's WebLog said:

It has been a little over a year since we shipped VS 2008 and .NET FX 3.5. Since then the team has been

# March 26, 2009 12:47 AM

Blog de Soma en español said:

Publicación del inglés original : Miércoles, 25 de marzo de 2009 a las 1:02 PST por Somasegar Hace poco

# March 26, 2009 11:35 PM

US ISV Developer Evangelism Team said:

S. Somasegar, Senior Vice President Developer Division, has provided a catalog of developer tools that

# March 31, 2009 1:02 PM

梦想 said:

上个月,我在博客里宣布了微软将对jQuery提供支持。在过去的几个星期里,我们与jQuery开发团队合作,在Studio2008和VisualWebDeveloper2008Expres...

# April 26, 2009 12:15 PM
New Comments to this post are disabled
Page view tracker