views:

249

answers:

3

Hi folks, I have searched on google, followed scottguthrie's article & also here on SO for a solution but to no avail. My environment consists of VS2008 SP1, including hotfix for JQuery intellisense.

I have downloaded 'jquery-1.4.1.js' & also 'jquery-1.4.1-vsdoc.js' from the jquery website. Referenced it in an 'HTM' file like this:

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

and when i write code like below, there is no intellisense.

<script type="text/javascript">     
  $
</script>

Any ideas? TIA

+1  A: 

while in your script tag, press CTRL-SHIFT-J. Watch the status bar for messages e.g. 'updateing js intellisense'

Then look at your Errors List and make sure there were no errors.

VS actually parses all the referenced javascript, effectively compiling it, to generate intellisense.

If there are errors in the JS, intellisense is broken. That is just the way it is. It encourages clean code with tough love.

jQuery is a notorious source of intellisense breakage. Get a baseline by closing all documents, create a new html, reference jquery, ensure the vsdoc file has the same name + -vsdoc and that it is in the same directory. Press CTRL-SHIFT-J and ensure no errors have borked intellisense.

Then start adding your scripts.

Good luck.

Sky Sanders
It's actually CTRL-SHIFT-J, but still doesn't work.
SoftwareGeek
@Wisdom, right you are. Just writing off the top of my head. Fixed. Question: what do you see in the Errors List window? I am using 1.4.1 with docs with no problem.
Sky Sanders
Actually, there aren't any errors but it appears to be an issue with VS2008 SP1. Stay tuned.
SoftwareGeek
A: 

Works! It turns out to be an issue with VS2008 SP1, i have no idea why but after re-installing it, intellisense works.

SoftwareGeek
A: 

@BhejaFry Did you reinstall only the SP1 or entire Visual Studio?

I have the exact same problem - intellisense works in .js files but it doesn't work for .aspx or .ascx. I use the hack:

<% if(false)
 {%>
    <script type="text/javascript" src="/Scripts/jquery-1.4.1.js"></script>
    <%
 }%>

But also in files that I use the script normally I don't get intellisense. Of course I have the htofix and -vsdoc. Id doesn't seem to help.

brainnovative

related questions