JavaScript Intellisense Not Working on Visual Studio 2010

We are using JavaScript to manipulate the HTML document or more specifically, the DOM (document object model). jQuery as a JavaScript framework now seems to be the first choice of developers for efficiency and productivity. You can use NuGet to install the jQuery package in the Visual Studio 2012, which supports JavaScript intellisense very well.

To be reminded that we are programming against an HTML document with JavaScript or jQuery, just remember to establish some kind of connection between the HTML document and the JavaScript files or the JavaScript intellisense won’t work properly. You would receive the following message:

intellisense was unable to determine an accurate completion list for this expression, The provided list contains all identifiers in the file

If you installed jQuery from NuGet and JavaScript intellisense won’t work, do either of the following:

  • in the HTML document, add the <script> tag  to import your JavaScript file or
  • at the beginning of your JavaScript file, add a remarked reference to the HTML document you’re working with
    /// <reference path=”../default.html” />
    You can drag and drop the HTML document into the JavaScript file if you are using Visual Studio 2012

JavaScriptIntellisenseHTML JavaScriptIntellisensSource

Advertisements

Tagged: , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: