Weitere ähnliche Inhalte Ähnlich wie WCF & JQuery (20) Kürzlich hochgeladen (20) WCF & JQuery1. WCF & JQuerY Chris Love Tellago Inc. http://ProfessionalASPNET.com http://Twitter.com/ChrisLove 3. References Rick Strahl – Smart Dude http://west-wind.com Don Demsak (DonXML) – Wise Guy http://donxml.com John Resig – The JQuery Creator (pay homage here) 4. Touching on WCF All About the Messages Can be Rather Complicated Configuration Attributes Debugging Making Things Easier Astoria oData 6. Jquery AJAX Features Very Flexible Global Event Handlers Graceful Event Handling All the Super Goodness Baked into JQuery!!! 7. JSON The Data Format LCD Simple (And that’s the way I like it!) WCF Just Handles it for Us! JSON2 from Crockford http://JSON.org 8. JqueryTemplating Cloning varnewEl = $("#ContactRowTemplate").clone() .attr("id",item.ContactId) .fadeIn("slow"); jTemplates Python-Like Syntax MicroTemplating $("#tblContactListtbody").empty() .html($("#ContactRowTemplate") .parseTemplate({ contacts: response.Contacts})); http://ejohn.org/blog/javascript-micro-templating/ http://www.west-wind.com/Weblog/posts/509108.aspx 9. JqueryTemplating <script id="ContactRowTemplate" type="text/html"> <# for(vari=0; i < contacts.length; i++) { var contact = contacts[i]; #> <tr> <td> <#=contact.FirstName#> <#=contact.LastName#> </td> <td> <#=contact.City#> </td> <td> <#=contact.State#> </td> <td><imgsrc="images/edit.gif" onclick="GetContactInfo(<#=contact.ContactId#>);" /></td> </tr> <# } #> </script> 10. Jquery Global AJAX Stuff Jquery.ajax .ajaxComplete() .ajaxError() .ajaxSend() .ajaxStart() .ajaxSuccess() $(document).ready(function() { ajaxLog.ajaxStart(function(evt, request, settings) { vardt = new Date(); $(this).append("<br/><hr/>Starting request... " + dt.toLocaleString()); }); }); 11. Debugging Tools Visual Studio Fiddler IE 8 or FireFox w/Firebug Learn Common Errors/Exceptions Use Try Catch Don’t Make JavaScript Typos