March 14, 2012

How to enable Jquery intellisense in the VS2008

Question by Searcher

I downloaded jquery-1.7.1.min.js and jquery-1.7.1-vsdoc.js.
I am working with VS2008.
I included those .js files into my file. but while using jquery intellisense is not coming.
How to do that.I read the web site jquery intellisense. Even though i did like this i am not getting the intellisense. whats wrong in there. Please help me. I included in my file like this

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

Thanks,

Answer by Niranjan Kala

Have you checked the following statement on the Scottgu’s blog…

VS 2008 SP1 adds richer JavaScript intellisense support to Visual
Studio, and adds code completion support for a broad range of
JavaScript libraries.

The jQuery intellisense annotation support will work great with VS 2008 SP1.

First you need correct patch KB958502 – JScript Editor support for “-vsdoc.js” IntelliSense doc. files. Install it and use as:

my script tag said

<script type="text/javascript" source="Scripts/jquery-x.js"></script>

then follow these reference links:

jquery + intellisense + vs2008 pro fails to load
Jquery and Intellisense in VS 2008 with hotfix and SP1
jQuery Intellisense in VS 2008
jQuery and Microsoft
JQuery IntelliSense in Visual Studio 2008

Answer by Starx

To detect the file as an intellisense, you need to have at least SP1 of Visual Studio 2008 and Visual Studio 2008 Express. You can find it here

As per a blog post. You should do something like this

<script type="text/javascript" src="scripts/jquery-1.7.1.min.js"></script>.
<% if(false) { %>
    <script type="text/javascript" src="scripts/jquery-1.7.1-vsdoc.js"></script>
<% } %>

Author: Nabin Nepal (Starx)

Hello, I am Nabin Nepal and you can call me Starx. This is my blog where write about my life and my involvements. I am a Software Developer, A Cyclist and a Realist. I hope you will find my blog interesting. Follow me on Google+

...

Please fill the form - I will response as fast as I can!