Saturday, November 22, 2008

VS.NET 2008 Javascript IntelliSense Troubleshooting

OK - maybe everyone else knows this, but after about a year of getting so-so support for intellisense in Javascript I downloaded the latest hotfix and hoped that this would fix did not.  Since I have a very unhealthy addiction to Intellisense I figured out it was time to do a little troubleshooting and get this to work.  When adding the the script tags to my page to get intellisense, my Error List now contained the message:

Error updatign JScript IntelliSense: [SOMEPATH]\Temporary Internet Files\Content.IE5\[XXXX]\[XXX].js 'jQuery' is undefiend @ 9.1

So I figured if I could make this error go away chance are pretty good IntelliSense would start working again.  What I found is if you use the absolute path /FOO/FEE.JS in your script tag you get this error message.  If you don't and use a relative path ../FOO/FEE.JS all is well.

One other thing I found while searching the web (sorry I forgot the site so I can't give the person credit) is to get your Intellisense to work when using Masterpages

This allows for the design time to pickup the script file, but at run time the file won't be duplicated, especially since my JS files stored as a resource in.  I have my JS files compiled as an embedded resource and for some reason, adding those embedded resources to the ScriptManager, Scripts sections doesn't allow IntelliSense to add the files as you would expect.  Maybe in another year I'll get around to troubleshooting that, time to get some work done!


No comments:

Post a Comment