2. About myself 上官林傑 a.k.a. ericsk Experiences Developer Evangelist @ Microsoft Taiwan2011.03 ~ Organizer @ Taipei GTUG2009.08 ~ 2010.12 Military Service @ CHT2007.01 ~ 2011.02 http://plurk.com/ericskhttp://facebook.com/ericsk0313
3. Outlines What’s jQuery? jQueryIntegration in Microsoft Products Microsoft’s Contributions to jQuery
4. What’s jQuery? http://jquery.comhttps://github.com/jquery Lightweight, powerful, cross-browser JavaScript library Full CSS3 Selector Support Easy and useful DOM, Event, AJAX APIs Active communities, includes UI, tool, plugins, etc.
6. Integrates with MS Products Starts from Visual Studio® 2008 SP1 jQuery code intellisense Microsoft CDN also supports intellisense (VS2010) http://ajax.microsoft.com/ajax/jquery/jquery-1.5.1.min.js
7. jQuery Control for ASP.NET Implements ASP.NET toolkits with jQuery AJAX Control Toolkit Client Templates …
8. Community Engagement Created proposals to jQuery developer forum template、globalization、datalink jQuery accepted them as official plugins: http://github.com/jquery/jquery-tmpl http://github.com/jquery/jquery-global http://github.com/jquery/jquery-datalink
9. jQuery Template Project: https://github.com/jquery/jquery-tmpl Document: http://api.jquery.com/category/plugins/templates/ CDN: http://ajax.microsoft.com/ajax/jquery.templates/beta1/jquery.tmpl.min.js Render template with Array or Object. Simple template syntax
10. Templates 3 ways to prepare the template: $('<div>${foo}</div><div>${bar}</div>').tmpl(data) <script id="my-tmpl" type="text/x-jquery-tmpl"><div>${foo}</div><div>${bar}</div></script><script> $('#my-tmpl').tmpl(data)...</script> <div id="my-tmpl" style="display:none">${foo} says ${bar}.</div><script>$('#my-tmpl').tmpl(data)...</script>
11. Template Syntax ${variableOrExpression} {{html variableOrExpression}} Output HTML content {{if}} {{else}} {{/if}} Conditional tags. (else could be used as `else if`) {{each data}} ${$index} ${$value} {{/each}} Iterate over an array or object {{tmpl template}} ... {{/tmpl}} Composite templates {{wrap template}} ... {{/wrap}} Wrap with another template