簡體   English   中英

Visual Studio 2008 Express和jQuery

[英]Visual Studio 2008 Express and jQuery

一個非常基本的問題。

我剛剛安裝了Visual Studio 2008 Express Edition,並打算使用jQuery。

我聽說Visual Studio現在支持jQuery,但是我的問題是。

我需要怎么做才能使用它? VS安裝中已經包含了它嗎?還是需要單獨下載它並參考下載的庫?

謝謝

此處下載Visual Studio版本的jQuery(名稱中應帶有vsdoc)。

您可以使用此修復程序來自動檢測vsdoc js文件,或使用以下有點黑的解決方法:

對於ASP.NET文件中的jQuery intellisense:

<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>
<% } %>

“ if(false)”位可確保腳本實際上不會被包含在內,但intellisense仍會選擇引用。

對於另一個js文件中的jQuery intellisense:

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

ScottGu的博客是查找該問題(以及與此相關的當前大多數其他Visual Studio問題)答案的地方。

不包括在內。 您只需添加

<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>

到母版頁或單個頁(如果不使用母版頁)。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM