jax code camp 2010 good morning. iphone dev how to develop for the ios 4
Post on 20-Dec-2015
218 views
TRANSCRIPT
![Page 1: Jax Code Camp 2010 Good morning. iPhone Dev How to develop for the iOS 4](https://reader030.vdocuments.site/reader030/viewer/2022032704/56649d4e5503460f94a2e02b/html5/thumbnails/1.jpg)
Jax Code Camp 2010
Good morning
![Page 2: Jax Code Camp 2010 Good morning. iPhone Dev How to develop for the iOS 4](https://reader030.vdocuments.site/reader030/viewer/2022032704/56649d4e5503460f94a2e02b/html5/thumbnails/2.jpg)
iPhone Dev
•How to develop for the iOS 4
![Page 3: Jax Code Camp 2010 Good morning. iPhone Dev How to develop for the iOS 4](https://reader030.vdocuments.site/reader030/viewer/2022032704/56649d4e5503460f94a2e02b/html5/thumbnails/3.jpg)
jQuery 1.4 and ASP.NETJax Code Camp 2010
![Page 4: Jax Code Camp 2010 Good morning. iPhone Dev How to develop for the iOS 4](https://reader030.vdocuments.site/reader030/viewer/2022032704/56649d4e5503460f94a2e02b/html5/thumbnails/4.jpg)
About Me
•David Fekke
•Software Engineer
•Lender Processing Services
•Fekke L.L.C.
•iPhone, iPad and Android Apps
•ASP.NET and ColdFusion
![Page 5: Jax Code Camp 2010 Good morning. iPhone Dev How to develop for the iOS 4](https://reader030.vdocuments.site/reader030/viewer/2022032704/56649d4e5503460f94a2e02b/html5/thumbnails/5.jpg)
Douglas Crockford “Good architecture is necessary to give programs enough structure to be able to grow large without collapsing into a puddle of confusion.”
![Page 6: Jax Code Camp 2010 Good morning. iPhone Dev How to develop for the iOS 4](https://reader030.vdocuments.site/reader030/viewer/2022032704/56649d4e5503460f94a2e02b/html5/thumbnails/6.jpg)
John Resig“The DOM is a mess!”
![Page 7: Jax Code Camp 2010 Good morning. iPhone Dev How to develop for the iOS 4](https://reader030.vdocuments.site/reader030/viewer/2022032704/56649d4e5503460f94a2e02b/html5/thumbnails/7.jpg)
jQuery
•Javascript Framework
•2006
•Included with Visual Studio
•20% of all websites
•31% of top 10,000 websites
![Page 8: Jax Code Camp 2010 Good morning. iPhone Dev How to develop for the iOS 4](https://reader030.vdocuments.site/reader030/viewer/2022032704/56649d4e5503460f94a2e02b/html5/thumbnails/8.jpg)
Licensing
•FREE
•MIT License
•Included with Visual Studio
•Tell the lawyers to relax
![Page 9: Jax Code Camp 2010 Good morning. iPhone Dev How to develop for the iOS 4](https://reader030.vdocuments.site/reader030/viewer/2022032704/56649d4e5503460f94a2e02b/html5/thumbnails/9.jpg)
jQuery features
•Do a lot with very little code
•Chain multiple commands together
•AJAX Library
•UI Library
![Page 10: Jax Code Camp 2010 Good morning. iPhone Dev How to develop for the iOS 4](https://reader030.vdocuments.site/reader030/viewer/2022032704/56649d4e5503460f94a2e02b/html5/thumbnails/10.jpg)
Sample jQuery
$(“div.myClass”).fadeOut().addClass(“myNewClass”);
![Page 11: Jax Code Camp 2010 Good morning. iPhone Dev How to develop for the iOS 4](https://reader030.vdocuments.site/reader030/viewer/2022032704/56649d4e5503460f94a2e02b/html5/thumbnails/11.jpg)
Microsoft Support
•Microsoft on JQuery Board
•Supported since Visual Studio 2008 sp1
•Intellisense support
•Libraries come included in certain projects
![Page 12: Jax Code Camp 2010 Good morning. iPhone Dev How to develop for the iOS 4](https://reader030.vdocuments.site/reader030/viewer/2022032704/56649d4e5503460f94a2e02b/html5/thumbnails/12.jpg)
Getting Started
•Download from jquery.com
•Can use a CDN such as Google
•Include jQuery library in your html
![Page 13: Jax Code Camp 2010 Good morning. iPhone Dev How to develop for the iOS 4](https://reader030.vdocuments.site/reader030/viewer/2022032704/56649d4e5503460f94a2e02b/html5/thumbnails/13.jpg)
<script src="scripts/jquery.js" type="text/javascript"></script>
![Page 14: Jax Code Camp 2010 Good morning. iPhone Dev How to develop for the iOS 4](https://reader030.vdocuments.site/reader030/viewer/2022032704/56649d4e5503460f94a2e02b/html5/thumbnails/14.jpg)
<script type="text/javascript">
jQuery();</script>
![Page 15: Jax Code Camp 2010 Good morning. iPhone Dev How to develop for the iOS 4](https://reader030.vdocuments.site/reader030/viewer/2022032704/56649d4e5503460f94a2e02b/html5/thumbnails/15.jpg)
<script type="text/javascript">
$();</script>
![Page 16: Jax Code Camp 2010 Good morning. iPhone Dev How to develop for the iOS 4](https://reader030.vdocuments.site/reader030/viewer/2022032704/56649d4e5503460f94a2e02b/html5/thumbnails/16.jpg)
jQuery plays with others
•$ is an Alias of jQuery
•jQuery.noConflict(); will turn off $ alias
•Must be run in document ready()
![Page 17: Jax Code Camp 2010 Good morning. iPhone Dev How to develop for the iOS 4](https://reader030.vdocuments.site/reader030/viewer/2022032704/56649d4e5503460f94a2e02b/html5/thumbnails/17.jpg)
Page Load
•onload can be used, but not preferred
•$(document).ready() same as onload
•$() will work as a shortcut
![Page 18: Jax Code Camp 2010 Good morning. iPhone Dev How to develop for the iOS 4](https://reader030.vdocuments.site/reader030/viewer/2022032704/56649d4e5503460f94a2e02b/html5/thumbnails/18.jpg)
Sizzle Selector Library
•Selector Library now its own project
•Core to how jQuery works
•CSS 1-3 selectors for matching elements
![Page 19: Jax Code Camp 2010 Good morning. iPhone Dev How to develop for the iOS 4](https://reader030.vdocuments.site/reader030/viewer/2022032704/56649d4e5503460f94a2e02b/html5/thumbnails/19.jpg)
Querying in jQuery
•select any DOM element
•$(document); // Document object
•$(p); // all paragraph elements
•$(tr:nth-child(1)); // first row of each table
•$(p > a); // all anchors inside paragraph tags
![Page 20: Jax Code Camp 2010 Good morning. iPhone Dev How to develop for the iOS 4](https://reader030.vdocuments.site/reader030/viewer/2022032704/56649d4e5503460f94a2e02b/html5/thumbnails/20.jpg)
Trigger Events
•$(a#home).bind(“click”,fn);
•$(a#home).click(fn);
•$(a#home).live(“click”,fn);
![Page 21: Jax Code Camp 2010 Good morning. iPhone Dev How to develop for the iOS 4](https://reader030.vdocuments.site/reader030/viewer/2022032704/56649d4e5503460f94a2e02b/html5/thumbnails/21.jpg)
Utility functions
•$.trim(someString);
•$.makeArray(obj);
•$.unique(array)
![Page 22: Jax Code Camp 2010 Good morning. iPhone Dev How to develop for the iOS 4](https://reader030.vdocuments.site/reader030/viewer/2022032704/56649d4e5503460f94a2e02b/html5/thumbnails/22.jpg)
Traversing
•next(expr)
•previous(expr)
•parents(expr)
•siblings(expr)
•children(expr)
![Page 23: Jax Code Camp 2010 Good morning. iPhone Dev How to develop for the iOS 4](https://reader030.vdocuments.site/reader030/viewer/2022032704/56649d4e5503460f94a2e02b/html5/thumbnails/23.jpg)
Chaining
•$(‘p’).next().css(‘font’,’Times’).append(‘<br/>’);
![Page 24: Jax Code Camp 2010 Good morning. iPhone Dev How to develop for the iOS 4](https://reader030.vdocuments.site/reader030/viewer/2022032704/56649d4e5503460f94a2e02b/html5/thumbnails/24.jpg)
Use Each with Wrapped Sets
•$(a) returns array
•var single_item = $(a)[0];
•Each(function(){ //do something })
![Page 25: Jax Code Camp 2010 Good morning. iPhone Dev How to develop for the iOS 4](https://reader030.vdocuments.site/reader030/viewer/2022032704/56649d4e5503460f94a2e02b/html5/thumbnails/25.jpg)
AJAX
•jQuery.getJSON();
•jQuery.ajax();
![Page 26: Jax Code Camp 2010 Good morning. iPhone Dev How to develop for the iOS 4](https://reader030.vdocuments.site/reader030/viewer/2022032704/56649d4e5503460f94a2e02b/html5/thumbnails/26.jpg)
{"menu": { "id": "file", "value": "File", "popup": { "menuitem": [ {"value": "New", "onclick": "CreateNewDoc()"}, {"value": "Open", "onclick": "OpenDoc()"}, {"value": "Close", "onclick": "CloseDoc()"} ] }}}
![Page 27: Jax Code Camp 2010 Good morning. iPhone Dev How to develop for the iOS 4](https://reader030.vdocuments.site/reader030/viewer/2022032704/56649d4e5503460f94a2e02b/html5/thumbnails/27.jpg)
jQuery and .NET•Use REST over SOAP
•Try to use JSON over XML if possible
•WCF can output JSON
•var svc = new Sys.Data.DataService("j.svc")
•ASP.NET MVC can handle JSON actions
![Page 28: Jax Code Camp 2010 Good morning. iPhone Dev How to develop for the iOS 4](https://reader030.vdocuments.site/reader030/viewer/2022032704/56649d4e5503460f94a2e02b/html5/thumbnails/28.jpg)
Plugins
•jQuery is extensible
•Write your own
•jQuery.fn.mypluginname = fn()
•Huge Ecosystem of Plugins
![Page 29: Jax Code Camp 2010 Good morning. iPhone Dev How to develop for the iOS 4](https://reader030.vdocuments.site/reader030/viewer/2022032704/56649d4e5503460f94a2e02b/html5/thumbnails/29.jpg)
New to 1.4
•$().live(“eventType”, fn);
•$().closest(“eventType”, fn);
•$().proxy(fn, context);
![Page 30: Jax Code Camp 2010 Good morning. iPhone Dev How to develop for the iOS 4](https://reader030.vdocuments.site/reader030/viewer/2022032704/56649d4e5503460f94a2e02b/html5/thumbnails/30.jpg)
Demo
![Page 31: Jax Code Camp 2010 Good morning. iPhone Dev How to develop for the iOS 4](https://reader030.vdocuments.site/reader030/viewer/2022032704/56649d4e5503460f94a2e02b/html5/thumbnails/31.jpg)
Resources
•jQuery.com
•http://jqueryui.com
•http://jquery14.com
•http://www.manning.com/bibeault/
![Page 32: Jax Code Camp 2010 Good morning. iPhone Dev How to develop for the iOS 4](https://reader030.vdocuments.site/reader030/viewer/2022032704/56649d4e5503460f94a2e02b/html5/thumbnails/32.jpg)
?Questions
?
![Page 33: Jax Code Camp 2010 Good morning. iPhone Dev How to develop for the iOS 4](https://reader030.vdocuments.site/reader030/viewer/2022032704/56649d4e5503460f94a2e02b/html5/thumbnails/33.jpg)
How to Contact me
•davidfekke @ gmail dot com
•twitter @davidfekke
•Blog at http://www.fekke.com/blog/