Share
Embed
Rapidly Develop Mobile Web Applications with jQuery Mobile
This talk focuses on how to effectively use jQuery Mobile to develop robust, cross-platform, mobile web applications. We’ll present an overview of jQuery Mobile, outlining the goals and aims of the project and the pros and cons. You’ll learn the capabilities of jQuery Mobile, walk through the API and review current, sample applications. You’ll also look at an app appendTo has built that demonstrates how easy and efficient it is to build an application with jQuery Mobile.
Mike Hostetler
February 13, 2012
Transcript
124 slides
-
@mikehostetler BlackBerry DevCon Europe 2012 Rapidly Develop Mobile Web Applications
with Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 Mobile is available to 90%
Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 5.3 Billion+ Active Subscriptions http://www.itu.int/ITU-D/ict/material/FactsFigures2010.pdf
- Sept, 2011 Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 7% of US Traffic comes
from SmartPhones and Tablets http://www.comscore.com/Press_Events/Press_Releases/2011/10/ Smartphones_and_Tablets_Drive_Nearly_7_Percent_of_Total_U.S._Digital_Traffic - Sept. 2011 Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 Know Better ... Do Better
? Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 UPDATE! Know Better ... Do
Better Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 The is the web People
expect it to work everywhere Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 Unified System Universal Access Easy
Development Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 One Codebase - Multiple Platforms
Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 In <3 with Web Standards
Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 Built on jQuery Core ...
Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 Familiar API Style It’s just
jQuery! $( document ).delegate( ".city", "click", function ( e ) { $( "#dialog" ).one( "pagehide", function () { $.mobile.changePage( 'cities.php' ); }).dialog( "close" ); }); Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 Mobile Browser Grades Basic HTML
C B A Enhanced experience without Ajax Full experience with Ajax-based animated page transitions. Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 Compiles to Native + =
Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 Native Look & Feel vs.
Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 Offline Access, sort of (
) Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 These are hard problems ...
Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 Choose the right tool ...
Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 Just released jQuery Mobile 1.0.1
Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 Shipping in Visual Studio Soon
... Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 Download the code http://jquerymobile.com/download https://github.com/jquery/jquery-mobile
or use a CDN ... Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 Your First Page! <!DocType HTML>
<html> <head> ... <title>My first jQuery Mobile Page!</title> </head> <body> .... </body> </html> Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 Add the <script> tags ...
<!DocType HTML> <html> <head> .... <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0rc1/ jquery.mobile-1.0rc1.min.css" /> <script src="http://code.jquery.com/jquery-1.6.4.min.js"></script> <script src="http://code.jquery.com/mobile/1.0rc1/ jquery.mobile-1.0rc1.min.js"></script> </head> .... </html> Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 Add the <script> tags ...
<!DocType HTML> <html> <head> .... <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0rc1/ jquery.mobile-1.0rc1.min.css" /> <script src="http://code.jquery.com/jquery-1.6.4.min.js"></script> <script src="http://code.jquery.com/mobile/1.0rc1/ jquery.mobile-1.0rc1.min.js"></script> </head> .... </html> Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 Add the <script> tags ...
<!DocType HTML> <html> <head> .... <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0rc1/ jquery.mobile-1.0rc1.min.css" /> <script src="http://code.jquery.com/jquery-1.6.4.min.js"></script> <script src="http://code.jquery.com/mobile/1.0rc1/ jquery.mobile-1.0rc1.min.js"></script> </head> .... </html> Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 Building your Page <body> <div
data-role=”page”> <p>Hello World!</p> </div> </body> Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 The role of data attributes
... <body> <div data-role=”page”> <p>Hello World!</p> </div> </body> Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 Full Sample Page <body> <div
data-role=”page”> <div data-role=”header”> ... </div> <div data-role=”content”> ... </div> <div data-role=”footer”> ... </div> </div> </body> Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 Basic List <div data-role=”content”> <h2>Hello
World!</h2> <ul> <li>jQuery</li> <li>jQuery UI</li> <li>jQuery Mobile</li> <li>QUnit</li> </ul> </div> Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 Add the List View Role
<div data-role=”content”> <h2>Hello World!</h2> <ul data-role="listview"> <li>jQuery</li> <li>jQuery UI</li> <li>jQuery Mobile</li> <li>QUnit</li> </ul> </div> Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 Inset Style <div data-role=”content”> <h2>Hello
World!</h2> <ul data-role="listview" data-inset="true" > <li>jQuery</li> <li>jQuery UI</li> <li>jQuery Mobile</li> <li>QUnit</li> </ul> </div> Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 Add Links <ul data-role="listview" data-inset="true">
<li> <a href=”http://jquery.com”> jQuery </a> </li> ... </ul> Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 Ordered Lists <div data-role=”content”> <h2>Hello
World!</h2> <ol data-role="listview"> <li>jQuery</li> <li>jQuery UI</li> <li>jQuery Mobile</li> <li>QUnit</li> </ol> </div> Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 Nested Lists = Drillable Pages
Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 Count Bubbles <ul data-role="listview"> <li><a
href=”http://jquery.com”> jQuery <span class="ui-li-count">1.6.4</span> </a></li> ... </ul> Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 List Dividers <ul data-role="listview"> <li
data-role="list-divider">Core</li> <li>jQuery</li> <li data-role="list-divider">UI</li> <li>jQuery UI</li> <li>jQuery Mobile</li> <li data-role="list-divider">Testing</li> <li>QUnit</li> </ul> Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 Filter Bar <div data-role=”content”> <h2>Hello
World!</h2> <ul data-role="listview" data-filter="true"> .... </ul> </div> Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 Append, then Refresh! $(‘ul#jquery’). .append(
‘<li><a href=”http://sizzlejs.com”>Sizzle JS</a></li>’ ).listview( ‘refresh’ ); Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 Basic Theming <div data-role=”page” data-theme=”a”>
<div data-role=”content”> .... </div> </div> Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 External Links <ul data-role="listview" data-inset="true"
data-theme=”e”> <li> <a href=”http://jquery.com”> jQuery </a> </li> ... </ul> Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 Internal + Hijax + DOM
Injection <ul data-role="listview" data-inset="true" data-theme=”e”> <li> <a href=”jquery.html”> jQuery </a> </li> ... </ul> Click! Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 Internal + Hijax + DOM
Injection /index.html /jquery.html Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 Internal + Hijax + DOM
Injection /jquery.html /index.html Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 Internal + Hijax + DOM
Injection /jquery.html /index.html Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 External Links <ul data-role="listview" data-inset="true"
data-theme=”e”> <li> <a href=”http://jquery.com” data-transition="pop"> jQuery a’ Poppin </a> </li> ... </ul> Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 Multiple Pages, One DOM <body>
<div data-role=”page” id=”page1”> <p>Hello World!</p> </div> <div data-role=”page” id=”page2”> <p>Hello World!</p> </div> </body> Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 Pre-Fetching <body> <div data-role=”page” id=”page1”>
<p>Hello World!</p> <a href="prefetchMe.html" data-prefetch> ... </a> </div> <div data-role=”page” id=”page2”> <p>Hello World!</p> </div> </body> Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 Basic Form with Labels <div
data-role="content"> <form action="#" method="get"> <label for="example">Example:</label> <input type="text" name="example" value="" /> </form> </div> Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 Containers <div data-role="content"> <form action="#"
method="get"> <div data-role="fieldcontain"> <label for="example">Example:</label> <input type="text" name="example" value="" /> </div> </form> </div> Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 Text Input <div data-role="content"> <form
action="#" method="get"> <div data-role="fieldcontain"> <label for="example">Example:</label> <input type="text" name="example" value="" /> </div> </form> </div> Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 Text Input Helpers ”password” ”email”
”tel” Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 Flip Switch <form action="#" method="get">
<div data-role="fieldcontain"> <label for="slide">Flip switch:</label> <select name="slide" data-role="slider"> <option value="off">Off</option> <option value="on">On</option> </select> </div> </form> </div> Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 Radio Buttons <form action="#" method="get">
<div data-role="fieldcontain"> <input type="radio" name="choice-1" value="choice-1"> <label for="choice-1">Apples</label> </div> ... </form> </div> Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 Checkboxes Too <form action="#" method="get">
<div data-role="fieldcontain"> <input type="checkbox" name="choice-1" value="choice-1"> <label for="choice-1">Apples</label> </div> ... </form> </div> Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 Horizontal Set <form action="#" method="get">
<div data-role="fieldcontain" data-type=”horizontal”> <input type="checkbox" name="choice-1" value="choice-1"> <label for="choice-1">Apples</label> </div> ... </form> </div> Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 Select Lists <form action="#" method="get">
<div data-role="fieldcontain"> <label for="choice-1"> Choose shipping method:</label> <select name="choice-1"> <option value="std">Standard: 7 day </option> ... </select> </div> </form> </div> Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 Select Lists <form action="#" method="get">
<div data-role="fieldcontain"> <label for="choice-1"> Choose shipping method:</label> <select name="choice-1"> <option value="std">Standard: 7 day </option> ... </select> </div> </form> </div> Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 Select Lists - Non-Native <form
action="#" method="get"> <div data-role="fieldcontain"> <label for="choice-1"> Choose shipping method:</label> <select name="choice-1" data-native-menu="false"> <option value="std">Standard: 7 day </option> ... </select> </div> </form> Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 Dialog’s <div data-role="content"> <a href="foo.html"
data-rel="dialog">Open dialog</a> </div> Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 Button’s <div data-role="content"> <a href="#"
data-role="button"> Link Button</a> <a href="#" data-role="button" data-icon="star">Star Icon!</a> </div> Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 Toolbar’s <div data-role="page"> <div data-role="header"
data-position="inline"> <a href="index.html" data-icon="delete">Cancel</a> <h1>Edit Contact</h1> <a href="index.html" data-icon="check">Save</a> </div> </div> Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 Navbar’s <div data-role="page"> .... <div
data-role="footer"> <div data-role="navbar"> <ul> <li>Summary</li> ... </ul> </div> </div> </div> Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 Fixed Positioning <div data-role="page"> <div
data-role="header" data-position="fixed"> <h1>Fixed toolbars</h1> </div> </div> Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 Persistent Footer Bar <div data-role="footer">
<div data-role="navbar" class="ui-state-persist"> <p><a href=”#”>Friends</a></p> </div> </div> Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 New Events ‣tap, taphold ‣swipe,
swipeleft, swiperight ‣scrollstart, scrollstop ‣orientationchange ‣Page Load: pageloadbefore, pageload, pageloadfailed ‣Page Change: pagechangebefore, pagechange, pagechangefailed ‣Many More! Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 Virtual Mouse Events ‣vmouseover ‣vmousedown
‣vmousemove ‣vmouseup ‣vmouseclick - WARNING! ‣vmousecancel Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 Changing Pages // Mimic’s a
‘tap’ or ‘click’ $.mobile.changePage( ‘about/us.html’ OR $(‘#about’), { /* options */ } ); // Fetches external URL, inserts it into the DOM $.mobile.loadPage( ‘about/us.html’, { /* options */ } ); Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 Those data- attributes ... Don’t
use: $.data Use: jqmData() and jqmRemoveData() Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 URL’s & Paths $.mobile.path URL:
http://jblas:[email protected]:8080/mail/inbox? msg=1234&type=unread#msg-content obj = { domain: ‘http://jblas:[email protected]:8080’, host: ‘mycompany.com:8080’, pathname: ’/mail/inbox’, directory: ‘/mail/’ } Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 http://filamentgroup.com Thanks to the Filament
Group! Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 Thanks to the jQuery Mobile
Team! Monday, February 13, 12 -
@mikehostetler BlackBerry DevCon Europe 2012 Thank You! @mikehostetler http://mike-hostetler.com http://learn.appendto.com
Links: http://bitly.com/neWK0v Monday, February 13, 12