3

I've read through some of the other questions here on SO and haven't quite come across my problem. I've read all the documentation I can find, and it seems that merely having a -vsdoc file in the same directory and named in the same manner as my jQuery file is enough to get IntelliSense firing for jQuery.

This works for external .js files just fine - I use the /// <reference /> tag to get it working.

My problem is with .asp files that I am including jQuery on. This doesn't work:

<script type="text/javascript" src="path-to/jquery-latest.min.js"> 

This below does work, but is a poor solution, and not at all how I've read it should work.

<script type="text/javascript" src="path-to/jquery-latest-vsdoc.min.js"> 

Anyone have any tips on what I could be doing wrong?

p.campbell
  • 98,673
  • 67
  • 256
  • 322
tjsimmons
  • 733
  • 4
  • 10
  • 21
  • 2
    ...using classic ASP? Hehe. Couldn't help myself. – Justin Niessner Apr 18 '11 at 16:59
  • Classic ASP was far better than web forms... – Aliostad Apr 18 '11 at 17:01
  • Yep. Not my choice, but it works just fine for what we're doing with it, and I'm using jQuery to fill some of the gaps. I don't need the IntelliSense, really, but some of the newer programmers could probably use it, and it'd be nice to have. – tjsimmons Apr 18 '11 at 17:03

2 Answers2

2

According to this blog post, in Visual studio 2008 (with hotfix) and above it looks for the javascript file with -vsdoc opportunistically.

It looks for scriptname-vsdoc.js, then scriptname.debug.js then scriptname.js. And each file requires the ///<reference /> tag.

I would check out this post too: Is possible to use jQuery intellisense with classic asp?

Do you have any links for sites that say otherwise?

Community
  • 1
  • 1
Ash Clarke
  • 4,807
  • 1
  • 37
  • 48
  • That's exactly what I said. [This](http://blog.tallan.com/2010/12/06/add-jquery-intellisense-to-visual-studio/) has what's in your link, and in my post. That's supposed to work, but isn't. – tjsimmons Apr 18 '11 at 17:23
  • Sorry I didn't mean to repeat you, I just noticed that your path to the vsdoc had -vsdoc.min before the .js, rather than .min-vsdoc – Ash Clarke Apr 18 '11 at 17:35
  • No problem, I was more trying to confirm we were saying the same thing. That very well could be it - I never thought that was the issue. I'll give that a try. Edit: No dice. Renaming to jquery-latest.min-vsdoc.js didn't do anything different. – tjsimmons Apr 18 '11 at 17:38
  • Just to clarify, you mentioned you have used the reference xml doc comment in your js, but have you tried it at the very top of your asp file also? This is a bit of a 'shot in the dark'. (It has been a long while since I did ASP, but I can't remember whether it is as picky as PHP is with what you put on your first line) – Ash Clarke Apr 18 '11 at 17:51
  • Aye, I've done the `/// ` at the top of the file, but that didn't work either. – tjsimmons Apr 18 '11 at 19:30
1

I'm using visual studio 2010, in mvc 3 project I couldn't use jquery intellisence. I search every where I could but nothing useful find.

finally I got the problem:

change

 <script src=@Url.Content("~/Scripts/jquery-1.5.1.min.js") 
    type="text/javascript">

To

  <script src="../../Scripts/jquery-1.5.1.js" type="text/javascript">

VS doesn't understand @Url.Content

Vahid Hassani
  • 676
  • 1
  • 6
  • 20