Visual Studio 2008 Express和jQuery

问题描述:

一个非常基本的问题。Visual Studio 2008 Express和jQuery

我刚刚安装了Visual Studio 2008 Express Edition,并准备使用jQuery。

我听说jQuery现在被Visual Studio支持,但我的问题是。

我需要做些什么来使用它?是否已包含在VS安装中,还是需要单独下载并参考下载的库?

谢谢

下载Visual Studio版本的jQuery(在名称中应该有vsdoc)here

您可以使用this hotfix有自动检测vsdoc js文件,或使用这种略带hackish的解决方法:

在ASP.NET文件jQuery的智能提示:

<script src="jquery-1.3.2.min.js" type="text/javascript"></script> 
<% if (false) { %} 
    <script src="jquery-1.3.2-vsdoc.js" type="text/javascript"></script> 
<% } %> 

的“如果(假)“位确保脚本不会实际包含,但智能感知仍然会提取参考。

对于另一个js文件jQuery的智能提示:

// <reference path="jquery-1.3.2-vsdoc.js" /> 

ScottGu's blog就是去找到这个问题的答案(以及与此有关的其他大多数当前的Visual Studio问题)

+0

感谢您的链接,但我已经看到了那个帖子了。我想知道是否有什么改变,特别是现在Web平台安装程序可用 – padn 2009-06-12 21:52:23

不包括它的地方。您只需将

<script type="text/javascript"> 
    // You may specify partial version numbers, such as "1" or "1.3", 
    // with the same result. Doing so will automatically load the 
    // latest version matching that partial revision pattern 
    // (i.e. both 1 and 1.3 would load 1.3.2 today). 
    google.load("jquery", "1.2.6"); 

    google.setOnLoadCallback(function() { 
     // Place init code here instead of $(document).ready() 
    }); 
</script> 

添加到您的母版页或单个页面(如果不使用母版页)。

+0

我认为他想vsdoc版本获得jQuery intellisense – palmsey 2009-06-12 22:00:46

+0

@palmsay - 是的你是对的。我相信博士建议的方法非常适合部署代码,但我相信我需要我的本地副本用于Intellisense,并且无需互联网访问工作 – padn 2009-06-12 22:04:45