quick & dirty mobile web with jquery mobile

130
Quick & Dirty Mobile Web with jQuery Mobile TROY MILES - [email protected] Saturday, November 10, 12

Upload: troy-miles

Post on 08-May-2015

3.513 views

Category:

Technology


0 download

DESCRIPTION

Want to make your site support the mobile web quickly? In this talk I show how to quickly add mobile to an existing website with jQuery Mobile. I also cover an easy way to do mobile device detection and redirection.

TRANSCRIPT

Page 1: Quick & Dirty Mobile Web with jQuery Mobile

Quick & Dirty Mobile Web with jQuery MobileTROY MILES - [email protected]

Saturday, November 10, 12

Page 2: Quick & Dirty Mobile Web with jQuery Mobile

Sponsors

Saturday, November 10, 12

Page 3: Quick & Dirty Mobile Web with jQuery Mobile

Our Agenda 3

Saturday, November 10, 12

Page 4: Quick & Dirty Mobile Web with jQuery Mobile

Our Agenda

Why Mobile Web?

3

Saturday, November 10, 12

Page 5: Quick & Dirty Mobile Web with jQuery Mobile

Our Agenda

Why Mobile Web? Why jQuery Mobile?

3

Saturday, November 10, 12

Page 6: Quick & Dirty Mobile Web with jQuery Mobile

Our Agenda

Why Mobile Web? Why jQuery Mobile? 4 Ways to Add Mobile to Your Site

3

Saturday, November 10, 12

Page 7: Quick & Dirty Mobile Web with jQuery Mobile

Our Agenda

Why Mobile Web? Why jQuery Mobile? 4 Ways to Add Mobile to Your Site Detecting A Mobile Device

3

Saturday, November 10, 12

Page 8: Quick & Dirty Mobile Web with jQuery Mobile

Our Agenda

Why Mobile Web? Why jQuery Mobile? 4 Ways to Add Mobile to Your Site Detecting A Mobile Device Let’s Get Dirty!

3

Saturday, November 10, 12

Page 9: Quick & Dirty Mobile Web with jQuery Mobile

Our Agenda

Why Mobile Web? Why jQuery Mobile? 4 Ways to Add Mobile to Your Site Detecting A Mobile Device Let’s Get Dirty! Next Steps

3

Saturday, November 10, 12

Page 10: Quick & Dirty Mobile Web with jQuery Mobile

Our Agenda

Why Mobile Web? Why jQuery Mobile? 4 Ways to Add Mobile to Your Site Detecting A Mobile Device Let’s Get Dirty! Next Steps Summary

3

Saturday, November 10, 12

Page 11: Quick & Dirty Mobile Web with jQuery Mobile

Why Mobile Web? 4

Saturday, November 10, 12

Page 12: Quick & Dirty Mobile Web with jQuery Mobile

Why Mobile Web?

Mobile is Where Growth Is

4

Saturday, November 10, 12

Page 13: Quick & Dirty Mobile Web with jQuery Mobile

Why Mobile Web?

Mobile is Where Growth Is 20% of Internet Users in the US & UK are Mobile Only

4

Saturday, November 10, 12

Page 14: Quick & Dirty Mobile Web with jQuery Mobile

Why Mobile Web?

Mobile is Where Growth Is 20% of Internet Users in the US & UK are Mobile Only In Some African & Asian Markets it is Over 50%

4

Saturday, November 10, 12

Page 15: Quick & Dirty Mobile Web with jQuery Mobile

Why Mobile Web?

Mobile is Where Growth Is 20% of Internet Users in the US & UK are Mobile Only In Some African & Asian Markets it is Over 50% Twitter began Showing Ads in April 2012

4

Saturday, November 10, 12

Page 16: Quick & Dirty Mobile Web with jQuery Mobile

Why Mobile Web?

Mobile is Where Growth Is 20% of Internet Users in the US & UK are Mobile Only In Some African & Asian Markets it is Over 50% Twitter began Showing Ads in April 2012

Mobile is Now Responsible for more than 50% of its Ad Revenue

4

Saturday, November 10, 12

Page 17: Quick & Dirty Mobile Web with jQuery Mobile

Why Mobile Web?

Mobile is Where Growth Is 20% of Internet Users in the US & UK are Mobile Only In Some African & Asian Markets it is Over 50% Twitter began Showing Ads in April 2012

Mobile is Now Responsible for more than 50% of its Ad Revenue A Campaign with P.F.Chang got 1 million clicks in its First 4 Days

4

Saturday, November 10, 12

Page 18: Quick & Dirty Mobile Web with jQuery Mobile

Why Mobile Web?

Mobile is Where Growth Is 20% of Internet Users in the US & UK are Mobile Only In Some African & Asian Markets it is Over 50% Twitter began Showing Ads in April 2012

Mobile is Now Responsible for more than 50% of its Ad Revenue A Campaign with P.F.Chang got 1 million clicks in its First 4 Days 70% of Those Clicks Came From Mobile

4

Saturday, November 10, 12

Page 19: Quick & Dirty Mobile Web with jQuery Mobile

What is jQuery Mobile?

A unified, HTML5-based user interface system for all popular mobile device platforms, built on the rock-solid jQuery and jQuery UI foundation. Its lightweight code is built with progressive enhancement, and has a flexible, easily theme-able design. 

Requires jQuery.

5

Saturday, November 10, 12

Page 20: Quick & Dirty Mobile Web with jQuery Mobile

Why jQuery Mobile? 6

Saturday, November 10, 12

Page 21: Quick & Dirty Mobile Web with jQuery Mobile

Why jQuery Mobile?

Its Free

6

Saturday, November 10, 12

Page 22: Quick & Dirty Mobile Web with jQuery Mobile

Why jQuery Mobile?

Its Free Its Easy to Learn

6

Saturday, November 10, 12

Page 23: Quick & Dirty Mobile Web with jQuery Mobile

Why jQuery Mobile?

Its Free Its Easy to Learn It Extends HTML5

6

Saturday, November 10, 12

Page 24: Quick & Dirty Mobile Web with jQuery Mobile

Why jQuery Mobile?

Its Free Its Easy to Learn It Extends HTML5 It Supports a Wide Range of Devices

6

Saturday, November 10, 12

Page 25: Quick & Dirty Mobile Web with jQuery Mobile

Why jQuery Mobile?

Its Free Its Easy to Learn It Extends HTML5 It Supports a Wide Range of Devices It is Not Feature Rich

6

Saturday, November 10, 12

Page 26: Quick & Dirty Mobile Web with jQuery Mobile

Why jQuery Mobile?

Its Free Its Easy to Learn It Extends HTML5 It Supports a Wide Range of Devices It is Not Feature Rich It is Not Performant

6

Saturday, November 10, 12

Page 27: Quick & Dirty Mobile Web with jQuery Mobile

4 Ways to Add Mobile 7

Saturday, November 10, 12

Page 28: Quick & Dirty Mobile Web with jQuery Mobile

4 Ways to Add Mobile

Have Two Separate Sites Have Single Site, With Separate Controllers Single Site, With Separate Views Responsive Design And yes, there are other ways

7

Saturday, November 10, 12

Page 29: Quick & Dirty Mobile Web with jQuery Mobile

Have Two Separate Sites 8

Saturday, November 10, 12

Page 30: Quick & Dirty Mobile Web with jQuery Mobile

Have Two Separate Sites

Easy To Start

8

Saturday, November 10, 12

Page 31: Quick & Dirty Mobile Web with jQuery Mobile

Have Two Separate Sites

Easy To Start Difficult to Share Code and Resources Between Sites

8

Saturday, November 10, 12

Page 32: Quick & Dirty Mobile Web with jQuery Mobile

Have Two Separate Sites

Easy To Start Difficult to Share Code and Resources Between Sites Quickly Can Become a Maintenance Monster

8

Saturday, November 10, 12

Page 33: Quick & Dirty Mobile Web with jQuery Mobile

Have Two Separate Sites

Easy To Start Difficult to Share Code and Resources Between Sites Quickly Can Become a Maintenance Monster

Two Sites to Deploy

8

Saturday, November 10, 12

Page 34: Quick & Dirty Mobile Web with jQuery Mobile

Have Two Separate Sites

Easy To Start Difficult to Share Code and Resources Between Sites Quickly Can Become a Maintenance Monster

Two Sites to Deploy Two Databases to Deploy

8

Saturday, November 10, 12

Page 35: Quick & Dirty Mobile Web with jQuery Mobile

Have Two Separate Sites

Easy To Start Difficult to Share Code and Resources Between Sites Quickly Can Become a Maintenance Monster

Two Sites to Deploy Two Databases to Deploy Two Sites to Maintain

8

Saturday, November 10, 12

Page 36: Quick & Dirty Mobile Web with jQuery Mobile

Have Two Separate Sites

Easy To Start Difficult to Share Code and Resources Between Sites Quickly Can Become a Maintenance Monster

Two Sites to Deploy Two Databases to Deploy Two Sites to Maintain Two Sites to Enhance

8

Saturday, November 10, 12

Page 37: Quick & Dirty Mobile Web with jQuery Mobile

Have Single Site, With Separate Controllers

9

Saturday, November 10, 12

Page 38: Quick & Dirty Mobile Web with jQuery Mobile

Have Single Site, With Separate Controllers

The Desktop & Mobile Sites Each Have Their Own Controllers

9

Saturday, November 10, 12

Page 39: Quick & Dirty Mobile Web with jQuery Mobile

Have Single Site, With Separate Controllers

The Desktop & Mobile Sites Each Have Their Own Controllers Allows for Some Sharing of Resources

9

Saturday, November 10, 12

Page 40: Quick & Dirty Mobile Web with jQuery Mobile

Have Single Site, With Separate Controllers

The Desktop & Mobile Sites Each Have Their Own Controllers Allows for Some Sharing of Resources Only One Deployment

9

Saturday, November 10, 12

Page 41: Quick & Dirty Mobile Web with jQuery Mobile

Have Single Site, With Separate Controllers

The Desktop & Mobile Sites Each Have Their Own Controllers Allows for Some Sharing of Resources Only One Deployment Bugs in the Controller or View

9

Saturday, November 10, 12

Page 42: Quick & Dirty Mobile Web with jQuery Mobile

Single Site, With Separate Views 10

Saturday, November 10, 12

Page 43: Quick & Dirty Mobile Web with jQuery Mobile

Single Site, With Separate Views

Code in the Controller Decides Which View to Show

10

Saturday, November 10, 12

Page 44: Quick & Dirty Mobile Web with jQuery Mobile

Single Site, With Separate Views

Code in the Controller Decides Which View to Show High Degree of Code Sharing

10

Saturday, November 10, 12

Page 45: Quick & Dirty Mobile Web with jQuery Mobile

Single Site, With Separate Views

Code in the Controller Decides Which View to Show High Degree of Code Sharing Users Get Locked into an Experience

10

Saturday, November 10, 12

Page 46: Quick & Dirty Mobile Web with jQuery Mobile

Single Site, With Separate Views

Code in the Controller Decides Which View to Show High Degree of Code Sharing Users Get Locked into an Experience

Users Hate Getting Stuck

10

Saturday, November 10, 12

Page 47: Quick & Dirty Mobile Web with jQuery Mobile

Single Site, With Separate Views

Code in the Controller Decides Which View to Show High Degree of Code Sharing Users Get Locked into an Experience

Users Hate Getting Stuck Users Sometimes Want to View the Full Site on Their Smart Phone

10

Saturday, November 10, 12

Page 48: Quick & Dirty Mobile Web with jQuery Mobile

Responsive Design 11

Saturday, November 10, 12

Page 49: Quick & Dirty Mobile Web with jQuery Mobile

Responsive Design

A Single Site With Single Controller and Views

11

Saturday, November 10, 12

Page 50: Quick & Dirty Mobile Web with jQuery Mobile

Responsive Design

A Single Site With Single Controller and Views Site Uses CSS to Dynamically Resize Itself

11

Saturday, November 10, 12

Page 51: Quick & Dirty Mobile Web with jQuery Mobile

Responsive Design

A Single Site With Single Controller and Views Site Uses CSS to Dynamically Resize Itself When Done Right It Looks Amazing

11

Saturday, November 10, 12

Page 52: Quick & Dirty Mobile Web with jQuery Mobile

Responsive Design

A Single Site With Single Controller and Views Site Uses CSS to Dynamically Resize Itself When Done Right It Looks Amazing Difficult To Do Right

11

Saturday, November 10, 12

Page 53: Quick & Dirty Mobile Web with jQuery Mobile

Responsive Design

A Single Site With Single Controller and Views Site Uses CSS to Dynamically Resize Itself When Done Right It Looks Amazing Difficult To Do Right Has Performance Issues

11

Saturday, November 10, 12

Page 54: Quick & Dirty Mobile Web with jQuery Mobile

Responsive Design

A Single Site With Single Controller and Views Site Uses CSS to Dynamically Resize Itself When Done Right It Looks Amazing Difficult To Do Right Has Performance Issues

The Scaling Is Done on the Client

11

Saturday, November 10, 12

Page 55: Quick & Dirty Mobile Web with jQuery Mobile

Responsive Design

A Single Site With Single Controller and Views Site Uses CSS to Dynamically Resize Itself When Done Right It Looks Amazing Difficult To Do Right Has Performance Issues

The Scaling Is Done on the Client Entire Site Sent To The Client, But Much of it May Not Be Used

11

Saturday, November 10, 12

Page 56: Quick & Dirty Mobile Web with jQuery Mobile

Responsive Design Sites 12

Saturday, November 10, 12

Page 57: Quick & Dirty Mobile Web with jQuery Mobile

Responsive Design Sites

http://bostonglobe.com/ http://2012.inspireconf.com/ http://forefathersgroup.com/ http://www.thesearethings.com/

12

Saturday, November 10, 12

Page 58: Quick & Dirty Mobile Web with jQuery Mobile

Detecting A Mobile Device 13

Saturday, November 10, 12

Page 59: Quick & Dirty Mobile Web with jQuery Mobile

Detecting A Mobile Device

Nearly All Mobile Device Detection Algorithms Rely on the User Agent

13

Saturday, November 10, 12

Page 60: Quick & Dirty Mobile Web with jQuery Mobile

Detecting A Mobile Device

Nearly All Mobile Device Detection Algorithms Rely on the User Agent

The User Agent is a String Sent With Your Browser’s HTTP Request

13

Saturday, November 10, 12

Page 61: Quick & Dirty Mobile Web with jQuery Mobile

Detecting A Mobile Device

Nearly All Mobile Device Detection Algorithms Rely on the User Agent

The User Agent is a String Sent With Your Browser’s HTTP Request Information in the User Agent Identifies the Device, Browser, Version

Numbers, etc.

13

Saturday, November 10, 12

Page 62: Quick & Dirty Mobile Web with jQuery Mobile

Detecting A Mobile Device

Nearly All Mobile Device Detection Algorithms Rely on the User Agent

The User Agent is a String Sent With Your Browser’s HTTP Request Information in the User Agent Identifies the Device, Browser, Version

Numbers, etc. There are businesses which provide a service to map User Agents to

devices

13

Saturday, November 10, 12

Page 63: Quick & Dirty Mobile Web with jQuery Mobile

Detecting A Mobile Device

Nearly All Mobile Device Detection Algorithms Rely on the User Agent

The User Agent is a String Sent With Your Browser’s HTTP Request Information in the User Agent Identifies the Device, Browser, Version

Numbers, etc. There are businesses which provide a service to map User Agents to

devices They cost anywhere from $40 to $400 a month and more

13

Saturday, November 10, 12

Page 64: Quick & Dirty Mobile Web with jQuery Mobile

Detecting A Mobile Device

Nearly All Mobile Device Detection Algorithms Rely on the User Agent

The User Agent is a String Sent With Your Browser’s HTTP Request Information in the User Agent Identifies the Device, Browser, Version

Numbers, etc. There are businesses which provide a service to map User Agents to

devices They cost anywhere from $40 to $400 a month and more Luckily We Have a Free Way...

13

Saturday, November 10, 12

Page 65: Quick & Dirty Mobile Web with jQuery Mobile

Detecting A Mobile Device 14

Saturday, November 10, 12

Page 66: Quick & Dirty Mobile Web with jQuery Mobile

Detecting A Mobile Device

A website named: Detect Mobile Browsers

14

Saturday, November 10, 12

Page 67: Quick & Dirty Mobile Web with jQuery Mobile

Detecting A Mobile Device

A website named: Detect Mobile Browsers It Use Regular Expressions to Detect a Mobile Device

14

Saturday, November 10, 12

Page 68: Quick & Dirty Mobile Web with jQuery Mobile

Detecting A Mobile Device

A website named: Detect Mobile Browsers It Use Regular Expressions to Detect a Mobile Device It Provides Versions of Its Algorithm for: Apache, ASP, ASP.NET,

ColdFusion, C#, IIS, JSP, JavaScript, Lasso, nginx, node.js, and more

14

Saturday, November 10, 12

Page 69: Quick & Dirty Mobile Web with jQuery Mobile

Detecting A Mobile Device

A website named: Detect Mobile Browsers It Use Regular Expressions to Detect a Mobile Device It Provides Versions of Its Algorithm for: Apache, ASP, ASP.NET,

ColdFusion, C#, IIS, JSP, JavaScript, Lasso, nginx, node.js, and more The Algorithm gets Updated Every Few Months

14

Saturday, November 10, 12

Page 70: Quick & Dirty Mobile Web with jQuery Mobile

Let's Get Dirty! 15

Saturday, November 10, 12

Page 71: Quick & Dirty Mobile Web with jQuery Mobile

Let's Get Dirty!

jQuery At A Glance

15

Saturday, November 10, 12

Page 72: Quick & Dirty Mobile Web with jQuery Mobile

Let's Get Dirty!

jQuery At A Glance Make Copies

15

Saturday, November 10, 12

Page 73: Quick & Dirty Mobile Web with jQuery Mobile

Let's Get Dirty!

jQuery At A Glance Make Copies Add Detection Code

15

Saturday, November 10, 12

Page 74: Quick & Dirty Mobile Web with jQuery Mobile

Let's Get Dirty!

jQuery At A Glance Make Copies Add Detection Code Test It

15

Saturday, November 10, 12

Page 75: Quick & Dirty Mobile Web with jQuery Mobile

Let's Get Dirty!

jQuery At A Glance Make Copies Add Detection Code Test It Add Mobile ViewPort and Meta-tags

15

Saturday, November 10, 12

Page 76: Quick & Dirty Mobile Web with jQuery Mobile

Let's Get Dirty!

jQuery At A Glance Make Copies Add Detection Code Test It Add Mobile ViewPort and Meta-tags Add jQuery Mobile Files

15

Saturday, November 10, 12

Page 77: Quick & Dirty Mobile Web with jQuery Mobile

Let's Get Dirty!

jQuery At A Glance Make Copies Add Detection Code Test It Add Mobile ViewPort and Meta-tags Add jQuery Mobile Files Convert Our Index Page

15

Saturday, November 10, 12

Page 78: Quick & Dirty Mobile Web with jQuery Mobile

Let's Get Dirty!

jQuery At A Glance Make Copies Add Detection Code Test It Add Mobile ViewPort and Meta-tags Add jQuery Mobile Files Convert Our Index Page Convert Our Create Page

15

Saturday, November 10, 12

Page 79: Quick & Dirty Mobile Web with jQuery Mobile

jQuery Mobile At A Glance 16

Saturday, November 10, 12

Page 80: Quick & Dirty Mobile Web with jQuery Mobile

jQuery Mobile At A Glance

jQuery Uses Attributes to Enhance Markup

16

Saturday, November 10, 12

Page 81: Quick & Dirty Mobile Web with jQuery Mobile

jQuery Mobile At A Glance

jQuery Uses Attributes to Enhance Markup One of the Most Import Attributes is data-role

16

Saturday, November 10, 12

Page 82: Quick & Dirty Mobile Web with jQuery Mobile

jQuery Mobile At A Glance

jQuery Uses Attributes to Enhance Markup One of the Most Import Attributes is data-role By default jQuery Mobile Will Use Ajax Not Page Load

16

Saturday, November 10, 12

Page 83: Quick & Dirty Mobile Web with jQuery Mobile

jQuery Mobile At A Glance

jQuery Uses Attributes to Enhance Markup One of the Most Import Attributes is data-role By default jQuery Mobile Will Use Ajax Not Page Load HTML list are Special in jQuery With Lots of Features

16

Saturday, November 10, 12

Page 84: Quick & Dirty Mobile Web with jQuery Mobile

jQuery Mobile At A Glance

jQuery Uses Attributes to Enhance Markup One of the Most Import Attributes is data-role By default jQuery Mobile Will Use Ajax Not Page Load HTML list are Special in jQuery With Lots of Features jQuery Mobile is Very Semantic

16

Saturday, November 10, 12

Page 85: Quick & Dirty Mobile Web with jQuery Mobile

Let’s Get Dirty!

17

Saturday, November 10, 12

Page 86: Quick & Dirty Mobile Web with jQuery Mobile

Make Copies 18

Saturday, November 10, 12

Page 87: Quick & Dirty Mobile Web with jQuery Mobile

Make Copies

Copy the HomeController to MobileController

18

Saturday, November 10, 12

Page 88: Quick & Dirty Mobile Web with jQuery Mobile

Make Copies

Copy the HomeController to MobileController Copy _LayoutPage to _MobileLayoutPage

18

Saturday, November 10, 12

Page 89: Quick & Dirty Mobile Web with jQuery Mobile

Make Copies

Copy the HomeController to MobileController Copy _LayoutPage to _MobileLayoutPage Copy the Views

18

Saturday, November 10, 12

Page 90: Quick & Dirty Mobile Web with jQuery Mobile

Add Detection Code 19

Saturday, November 10, 12

Page 91: Quick & Dirty Mobile Web with jQuery Mobile

Add Detection Code

Create a Named Common

19

Saturday, November 10, 12

Page 92: Quick & Dirty Mobile Web with jQuery Mobile

Add Detection Code

Create a Named Common Create a Class Named DetectMobileBrowser.cs

19

Saturday, November 10, 12

Page 93: Quick & Dirty Mobile Web with jQuery Mobile

Add Detection Code

Create a Named Common Create a Class Named DetectMobileBrowser.cs Create a static Method, IsMobile, With the Following Signature:

19

Saturday, November 10, 12

Page 94: Quick & Dirty Mobile Web with jQuery Mobile

Add Detection Code

Create a Named Common Create a Class Named DetectMobileBrowser.cs Create a static Method, IsMobile, With the Following Signature: public static bool IsMobile(string u)

19

Saturday, November 10, 12

Page 95: Quick & Dirty Mobile Web with jQuery Mobile

Add Detection Code

Create a Named Common Create a Class Named DetectMobileBrowser.cs Create a static Method, IsMobile, With the Following Signature: public static bool IsMobile(string u) Add Call to IsMobile() to the Index Action of the HomeController

19

Saturday, November 10, 12

Page 96: Quick & Dirty Mobile Web with jQuery Mobile

Add Detection Code

Create a Named Common Create a Class Named DetectMobileBrowser.cs Create a static Method, IsMobile, With the Following Signature: public static bool IsMobile(string u) Add Call to IsMobile() to the Index Action of the HomeController If Detected, Redirect to the Index Action of the MobileController

19

Saturday, November 10, 12

Page 97: Quick & Dirty Mobile Web with jQuery Mobile

Test It 20

Saturday, November 10, 12

Page 98: Quick & Dirty Mobile Web with jQuery Mobile

Test It

Our Website Should Now Be Able To Detect Mobile Traffic

20

Saturday, November 10, 12

Page 99: Quick & Dirty Mobile Web with jQuery Mobile

Test It

Our Website Should Now Be Able To Detect Mobile Traffic Let’s Test It

20

Saturday, November 10, 12

Page 100: Quick & Dirty Mobile Web with jQuery Mobile

Test It

Our Website Should Now Be Able To Detect Mobile Traffic Let’s Test It We Will Use the Chrome Browser With the Ultimate User Agent

Switcher

20

Saturday, November 10, 12

Page 101: Quick & Dirty Mobile Web with jQuery Mobile

Test It

Our Website Should Now Be Able To Detect Mobile Traffic Let’s Test It We Will Use the Chrome Browser With the Ultimate User Agent

Switcher Launch the Website, It Should Go To the Home page

20

Saturday, November 10, 12

Page 102: Quick & Dirty Mobile Web with jQuery Mobile

Test It

Our Website Should Now Be Able To Detect Mobile Traffic Let’s Test It We Will Use the Chrome Browser With the Ultimate User Agent

Switcher Launch the Website, It Should Go To the Home page Turn on the Ultimate User Agent Switcher

20

Saturday, November 10, 12

Page 103: Quick & Dirty Mobile Web with jQuery Mobile

Test It

Our Website Should Now Be Able To Detect Mobile Traffic Let’s Test It We Will Use the Chrome Browser With the Ultimate User Agent

Switcher Launch the Website, It Should Go To the Home page Turn on the Ultimate User Agent Switcher Reload the Website, We Should Go to the Mobile Home page

20

Saturday, November 10, 12

Page 104: Quick & Dirty Mobile Web with jQuery Mobile

Add Mobile ViewPort and Meta-tags 21

Saturday, November 10, 12

Page 105: Quick & Dirty Mobile Web with jQuery Mobile

Add Mobile ViewPort and Meta-tags

Open Up the file _MobileLayoutPage.cshtml

21

Saturday, November 10, 12

Page 106: Quick & Dirty Mobile Web with jQuery Mobile

Add Mobile ViewPort and Meta-tags

Open Up the file _MobileLayoutPage.cshtml Add the meta-tags

21

Saturday, November 10, 12

Page 107: Quick & Dirty Mobile Web with jQuery Mobile

Add Mobile ViewPort and Meta-tags

Open Up the file _MobileLayoutPage.cshtml Add the meta-tags viewport, width=device-width

21

Saturday, November 10, 12

Page 108: Quick & Dirty Mobile Web with jQuery Mobile

Add Mobile ViewPort and Meta-tags

Open Up the file _MobileLayoutPage.cshtml Add the meta-tags viewport, width=device-width name=”apple-mobile-web-app-capable”, content=”yes”

21

Saturday, November 10, 12

Page 109: Quick & Dirty Mobile Web with jQuery Mobile

Add jQuery Mobile Files 22

Saturday, November 10, 12

Page 110: Quick & Dirty Mobile Web with jQuery Mobile

Add jQuery Mobile Files

Add the CSS Files

22

Saturday, November 10, 12

Page 111: Quick & Dirty Mobile Web with jQuery Mobile

Add jQuery Mobile Files

Add the CSS Files Add the Script Files

22

Saturday, November 10, 12

Page 112: Quick & Dirty Mobile Web with jQuery Mobile

Convert Our Index Page 23

Saturday, November 10, 12

Page 113: Quick & Dirty Mobile Web with jQuery Mobile

Convert Our Index Page

Convert the <table> into a <ul>

23

Saturday, November 10, 12

Page 114: Quick & Dirty Mobile Web with jQuery Mobile

Convert Our Index Page

Convert the <table> into a <ul> The data-role=”listview” Comes With Built In Styling

23

Saturday, November 10, 12

Page 115: Quick & Dirty Mobile Web with jQuery Mobile

Convert Our Index Page

Convert the <table> into a <ul> The data-role=”listview” Comes With Built In Styling Remove unnecessary elements

23

Saturday, November 10, 12

Page 116: Quick & Dirty Mobile Web with jQuery Mobile

Convert Our Create Page 24

Saturday, November 10, 12

Page 117: Quick & Dirty Mobile Web with jQuery Mobile

Convert Our Create Page

Use Hints Instead of Labels

24

Saturday, November 10, 12

Page 118: Quick & Dirty Mobile Web with jQuery Mobile

Convert Our Create Page

Use Hints Instead of Labels Use JQM Buttons

24

Saturday, November 10, 12

Page 119: Quick & Dirty Mobile Web with jQuery Mobile

Convert Our Create Page

Use Hints Instead of Labels Use JQM Buttons Theme It

24

Saturday, November 10, 12

Page 120: Quick & Dirty Mobile Web with jQuery Mobile

Next Steps 25

Saturday, November 10, 12

Page 121: Quick & Dirty Mobile Web with jQuery Mobile

Next Steps

Convert the Remaining Views

25

Saturday, November 10, 12

Page 122: Quick & Dirty Mobile Web with jQuery Mobile

Next Steps

Convert the Remaining Views Replace HTML Pages With Ajax

25

Saturday, November 10, 12

Page 123: Quick & Dirty Mobile Web with jQuery Mobile

Next Steps

Convert the Remaining Views Replace HTML Pages With Ajax Make the Site iOS Friendly

25

Saturday, November 10, 12

Page 124: Quick & Dirty Mobile Web with jQuery Mobile

Next Steps

Convert the Remaining Views Replace HTML Pages With Ajax Make the Site iOS Friendly

Add Home Page Icons (Android Supports These Too)

25

Saturday, November 10, 12

Page 125: Quick & Dirty Mobile Web with jQuery Mobile

Next Steps

Convert the Remaining Views Replace HTML Pages With Ajax Make the Site iOS Friendly

Add Home Page Icons (Android Supports These Too) Add Splash Page

25

Saturday, November 10, 12

Page 126: Quick & Dirty Mobile Web with jQuery Mobile

My Blog

http://therockncoder.blogspot.com/

26

Saturday, November 10, 12

Page 127: Quick & Dirty Mobile Web with jQuery Mobile

Please Rate My Talk

http://spkr8.com/t/18331

27

Saturday, November 10, 12

Page 128: Quick & Dirty Mobile Web with jQuery Mobile

Summary

Why Mobile Web? Why jQuery Mobile? 4 Ways to Add Mobile to Your Site Detecting A Mobile Device We Got Dirty Next Steps Summary

28

Saturday, November 10, 12

Page 130: Quick & Dirty Mobile Web with jQuery Mobile

Feedback

Saturday, November 10, 12