IT:AD:JQuery
- See also:
Summary
Source
Same basics as already defined in IT:AD:JScript:Include
- Official JQuery Site: to get the latest version, or know what the latest version is for CND (see below) check here:
- Or CDN:
Google CDN:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" type="text/javascript" ></script>
* Note: Regarding Google's CDN, read:
Microsoft CDN:
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.6.2.min.js" type="text/javascript" ></script>
Includes
From ASP.MVC, use ResolveClientUrl:
`<script src="<%=this.ResolveClientUrl("~/client/scripts/jquery-ui-1.8.9.xact/js/jquery-1.4.4.min.js") %>" type="text/javascript" ></script>`
Start
Syntax:
$(document).ready(function() {....} ); //shorthand: $(function() {...});
Traversing
You can traverse through a list response using the each
method:
$('h2').each(function(index) {this.innerHtml="Section" + index;}
Slow Loading
Navigation
Navigation is a huge part of the Web Experience…and covers more than just JQuery, so:
Inserting
Try:
$('#myTable > tbody:last').append('<tr>...</tr><tr>...</tr>');
Reference: http://stackoverflow.com/a/171049
Resources
* Good value:EletricToolBox