Link to home
Start Free TrialLog in
Avatar of kmcbrearty
kmcbreartyFlag for United States of America

asked on

jQuery Intellisense in Visual Studio 2010

I downloaded the files for the latest version of jQuery:

jquery-1.7.2-vsdoc.js
jquery-1.7.2.js
jquery-1.7.2.min.js

I have tried methods from several different articles that I have read to attempt to get intellisense to work but no matter what I do it will not work.  I have tried it in a standard page as well as a master page without any luck. All three files are located in a "js" folder.  The code that I am currently working with is:

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
      <!-- insert the script to reference jQuery here -->      
      <script src="../js/jquery-1.7.2.js" type="text/javascript"></script>
      <!-- insert the script to display the Hello World message here -->
      <script type="text/javascript">
          $('document').ready(function () {
              alert('Hello World!');
          });
      </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    </div>
    </form>
</body>
</html>

Open in new window

Avatar of Jon Norman
Jon Norman
Flag of United Kingdom of Great Britain and Northern Ireland image

the $('document') should be $(document):

$(document).ready(function () {
    alert('Hello World!');
});

Open in new window


if that still doesn't work, do you have any errors in the error console?

if still no joy try using the following source of jQuery
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js">

if that still doesn't work try:

<script type="text/javascript">
  alert("jQuery: " + typeof(jQuery)+"\n$(document): " + typeof($(document)));
    $(document).ready(function () {
      alert('Hello World!');
     });
</script>

Open in new window

and let me know what the alerts say
Avatar of kmcbrearty

ASKER

I do not have a problem getting jQuery to work on the page.  My issues is that I can not get intellisense to work as I try to use it.  

As for the alert it states "jQuery: function $(document): object".
ASKER CERTIFIED SOLUTION
Avatar of kmcbrearty
kmcbrearty
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
These were the steps that I took to solve the problem.