简体   繁体   English

jQuery和VS2010

[英]jQuery and VS2010

Can someone provide me with a HelloWorld JQuery sample app using VS2010 and list out any manual steps such as installation and setting of references/placement of script files necessary to make it work? 有人可以使用VS2010向我提供一个HelloWorld JQuery示例应用程序,并列出任何手动步骤,例如安装和设置参考文件/放置脚本文件以使其正常工作吗? It would also be great if intellisense would work, so if manual steps are necessary to get it to work, that would be nice to know too. 如果intellisense可以工作也很好,所以如果需要手动步骤来使其工作,那么也很高兴知道。

Most of the stuff I see is on VS2008 and I suspect that it is different/simpler in VS2010. 我看到的大多数内容都在VS2008上,我怀疑它在VS2010中是不同的/简单的。

Update. 更新。 I am still looking for a sample Hello World app. 我仍在寻找示例Hello World应用程序。 When I run the following I get: 当我运行以下命令时,我得到:

 <html>
    <head>
    <title>JQuery Hello World</title>

    <script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery/jquery-1.3.2.min.js"></script>

    </head>

    <script type="text/javascript">

        $(document).ready(function () {
            $("#msgid1").html("This is Hello World by JQuery 1");
        });

    </script>
    <body>

    This is Hello World by HTML

    <div id="msgid1">
    </div>

    </body>
    </html>

I get the error: 我得到错误:

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; InfoPath.1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; InfoPath.2; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; MS-RTC LM 8; MS-RTC EA 2; .NET4.0C; .NET4.0E)
Timestamp: Wed, 28 Apr 2010 16:06:23 UTC


    Message: Invalid character
    Line: 1
    Char: 1
    Code: 0
    URI: file:///c:/inetpub/wwwroot/jquery.js

Put this in the HEAD of your masterpage: 将其放在母版页头中:

<script type="text/javascript" language="javascript" src="http://ajax.microsoft.com/ajax/jquery/jquery-1.3.2.min.js"></script>

For intellisense, check here: 对于智能,请在这里检查:

http://weblogs.asp.net/scottgu/archive/2008/11/21/jquery-intellisense-in-vs-2008.aspx http://weblogs.asp.net/scottgu/archive/2008/11/21/jquery-intellisense-in-vs-2008.aspx

That's about it. 就是这样

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM