告诉大家一个非常好的消息,就是现在我们已可以让VS2008同时支持jQuery的智能提示功能啦

可以先看看下面的效果图:

怎样?酷吧,呵呵

想实现以上效果只需将一个 jQuery.IntelliSense.js 文件COPY到你项目的目录里就可以了,以下是安装步骤:

1.将jQuery.IntelliSense.js放到项目目录里

2.在需要智能提示的页面里加入

<script language = "javascript" src="jQuery.IntelliSense.js">script>


如果要在JS文件里,就写成

/// <reference path="jQuery.IntelliSense.js" />


OK,完成啦,然后你就可以尝试一下智能提示的感觉啦,呵呵


jQuery.IntelliSense.js可到以下获取
>http://brennan.offwhite.net/blog/2008/02/01/intellisense-for-jquery-in-visual-studio-2008/

或者直接在本地下载:
>https://files.cnblogs.com/winsonet/jQuery.IntelliSense.rar

如果下载下来的提示文件不是以-vsdoc结尾则需要改成-vsdoc.js结尾,这样才能被VS搜索到.
希望能对大家有帮助.

How do I use this file (today)?

If you're inside an ASPX page, you will need to add the following lines of code into (normally) the head of your page:

image

Why do we have a server-side conditional statement?  IntelliSense disregards conditional statements of this type, and thus loads the "vsdoc" file (overriding the normal one).  At runtime the if (false) statement will ensure it this documentation file is not rendered (and executed) as script.  This trick allows the "switching" behavior you want.

If you're in a JavaScript file, use the normal file reference syntax to refer to the "vsdoc" file.

image

There's no need for tricks here since this comment is only meaningful to IntelliSense.


其他相关文章:http://www.cnblogs.com/oec2003/archive/2009/06/21/1468153.html
http://blogs.msdn.com/webdevtools/archive/2008/10/28/rich-intellisense-for-jquery.aspx
http://blog.chinaunix.net/u1/47729/showart_1735969.html
posted on 2009-07-25 09:42  阿C's  阅读(539)  评论(1编辑  收藏  举报