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? 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.
Most of the stuff I see is on VS2008 and I suspect that it is different/simpler in VS2010.
Update. I am still looking for a sample Hello World app. 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
开发者_如何学JAVA 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
That's about it.
精彩评论