World Library  
Flag as Inappropriate
Email this Article

JQuery Mobile

Article Id: WHEBN0031609372
Reproduction Date:

Title: JQuery Mobile  
Author: World Heritage Encyclopedia
Language: English
Subject: Responsive web design, QUnit, Grok (Knowledge Base), NS Basic, Ajax (programming)
Publisher: World Heritage Encyclopedia

JQuery Mobile

jQuery Mobile
Developer(s) The jQuery Project
Initial release October 16, 2010 (2010-10-16)[1]
Stable release 1.4.5 / October 31, 2014 (2014-10-31)
Development status Active
Written in JavaScript
Size 351 KB / 142 KB (minified) / 40 KB (minified, gzipped)
Type Mobile application framework
License MIT [2]
Website .comjquerymobile

jQuery Mobile is a touch-optimized web framework (also known as a mobile framework), more specifically a JavaScript library, currently being developed by the jQuery project team. The development focuses on creating a framework compatible with a wide variety of smartphones and tablet computers,[3] made necessary by the growing but heterogeneous tablet and smartphone market.[4] The jQuery Mobile framework is compatible with other mobile app frameworks and platforms such as PhoneGap, Worklight[5] and more.


  • Compatible with all major mobile platforms as well as all major desktop browsers, including iOS, Android, Blackberry, WebOS, Symbian, Windows Phone, and more.
  • Built on top of jQuery core so it has a minimal learning curve for people already familiar with jQuery syntax.
  • Theming framework that allows creation of custom themes.
  • Limited dependencies and lightweight to optimize speed.
  • The same underlying codebase will automatically scale to any screen
  • HTML5-driven configuration for laying out pages with minimal scripting
  • Ajax-powered navigation with animated page transitions that provides ability to clean URLs through pushState.
  • UI widgets that are touch-optimized and platform-agnostic

(Source: from the jQuery Mobile website) [3]

Example usage

$('div').on('tap', function(event){
  alert('You tapped an element');

$(window).load(function() { // better to use $(document).ready(function(){
    $('.List li').on('click touchstart', function() {

A basic example

Every web project using jQuery Mobile is more or less built using the following code. It is important to link to the jQuery and jQuery Mobile JavaScript libraries, and stylesheet (the files can be downloaded and hosted locally, but it is recommended to link to the files hosted on the jQuery CDN).

The body contains divs with an attribute of "data-role". This attribute, via jQuery Mobile, defines the look and function of the div. A div with the data-role "page", for example, represents a screenful of content in the web project. A "page" can have divs defined by data-roles of "header", "content", and "footer" (but not necessarily - any HTML is allowed within the "page" div).

One HTML document can contain more than one "page" element, and thus more than one screenful of content. This way it is only necessary to load one file which includes multiple pages of content. One page can link to another page within the same file by referencing the page's id attribute (e.g. href="#second").

In the example below, two other data- attributes are used. The "data-theme" attribute tells the browser what theme to render. The "data-add-back-btn" attribute adds a back button to the page if set to "true".

Lastly, icons can be added to elements via the "data-icon" attribute. jQuery Mobile has fifty commonly-used icons built in.

A brief explanation of the Data Attributes used in this example:

data-role – Specifies the role of the element, such as header, content, footer, etc.

data-theme – Specifies which design theme to use for elements within a container. Can be set to: a or b.

data-position – Specifies whether the element should be fixed, in which case it will render at the top (for header) or bottom (for footer).

data-transition – Specifies one of ten built-in animations to use when loading new pages.

data-icon – Specifies one of fifty built-in icons that can be added to an element.

       Page Title

Page Header 1

Hello, world!

Go to second page

Page Footer 1

Page Header 2

Page content goes here.

Page Footer 2


jQuery Mobile provides a powerful theming framework that allows developers to customize color schemes and certain CSS aspects of UI features. Developers can use the jQuery Mobile ThemeRoller[6] application to customize these appearances and create highly branded experiences. After developing a theme in the ThemeRoller application, programmers can download a custom CSS file and include it in their project to use their custom theme.[7]

Each theme can contain up to 26 unique color "swatches," each of which consists of a header bar, content body, and button states. Combining different swatches allows developers to create a wider range of visual effects than they would be able to with just one swatch per theme. Switching between different swatches within a theme is as simple as adding an attribute called "data-theme" to HTML elements.

The default jQuery Mobile theme comes with five different color swatches, named "a", "b", "c", "d", and "e". Here is an example of how to create a toolbar with the "b" swatch:

Page Title

(Source: from the jQuery Mobile website) [3]

There are already a handful of open source style themes that are developed and supported by third-party organizations. One such open source style theme is the Metro style theme that was developed and released by Microsoft Open Technologies, Inc.[8] The Metro style theme is meant to mimic the UI of the Metro (design language) that Microsoft uses in its mobile operating systems.

Mobile browser support

Platform Version Native Phone Gap Opera Mobile Opera Mini Fennec Ozone Net front
0.9 8.5, 8.65 9.5 10 4.0 5.0 1.0 1.1* 0.9 4.0
iOS v2.2.1 A A
v3.1.3, v3.2 A A A
v4-7.0 A A A
Symbian S60 v3.1, v3.2 A A A A A C C
v5.0 C C C A C A
Symbian UIQ v3.0, v3.1 C
v3.2 C C
Symbian Platform v.3.0 A
BlackBerry OS v4.5 C C C
v4.6, v4.7 C C C B
v5.0 B A C A
v6.0 A A A
Android v1.5, v1.6 A A
v2.1 A A
v2.2 A A A* C* A*
Windows Mobile v6.1 C C C C B C B C
v6.5.1 C C C A A C A
v7.0 A A C A
webOS 1.4.1 A A
bada 1.0 A
Maemo 5.0 B B C B*
MeeGo 1.1* A* A* A*


  • A - High Quality. A browser that’s capable of, at minimum, utilizing media queries (a requirement for jQuery Mobile). These browsers will be actively tested against, but may not receive the full capabilities of jQuery Mobile.
  • B - Medium Quality. A capable browser that doesn’t have enough market share to warrant day-to-day testing. Bug fixes will still be applied to help these browsers.
  • C - Low Quality. A browser that is not capable of utilizing media queries. They will not be provided any jQuery Mobile scripting or CSS (falling back to plain HTML and simple CSS).
  • * - Upcoming browser. This browser is not yet released but is in alpha/beta testing.

(Source: from the jQuery Mobile website) [3]

Release history

Release date Version number
October 16 2010 1.0.0 Alpha 1
November 12, 2010 1.0.0 Alpha 2
February 4 2011 1.0.0 Alpha 3
March 31 2011 1.0.0 Alpha 4
April 7 2011 1.0.0 Alpha 4.1
June 20 2011 1.0.0 Beta 1
August 3 2011 1.0.0 Beta 2
September 8 2011 1.0.0 Beta 3
September 29 2011 1.0.0 RC1
October 19 2011 1.0.0 RC2
November 13 2011 1.0.0 RC3
November 16 2011 1.0.0
January 26 2012 1.0.1
February 28, 2012 1.1.0 RC1
April 6, 2012 1.1.0 RC2
April 13, 2012 1.1.0
June 28, 2012 1.1.1 RC1
July 12, 2012 1.1.1
August 1, 2012 1.2.0 Alpha
September 5, 2012 1.2.0 Beta
September 14, 2012 1.2.0 RC1
September 21, 2012 1.2.0 RC2
October 2, 2012 1.2.0
January 14, 2013 1.3.0 Beta
Febrruary 4, 2013 1.3.0 RC1
February 20, 2013 1.3.0
March 19, 2013 1.1.2
March 22, 2013 1.2.1
April 10, 2013 1.3.1
July 19, 2013 1.3.2
July 25, 2013 1.4.0 Alpha 1
August 15, 2013 1.4.0 Alpha 2
September 24, 2013 1.4.0 Beta 1
October 24, 2013 1.4.0 RC 1
December 23, 2013 1.4.0
February 12, 2014 1.4.1
February 28, 2014 1.4.2
July 1, 2014 1.4.3
September 12, 2014 1.4.4
October 31, 2014 1.4.5 (Latest Stable Version)

See also


  1. ^ jQuery Foundation - (2010-10-16). "jQuery Mobile Alpha 1 Released". Retrieved 2014-05-22. 
  2. ^ jQuery Foundation - (2012-09-10). "jQuery Licensing Changes". Retrieved 2013-10-09. 
  3. ^ a b c d "Mobile Graded Browser Support". 
  4. ^ "The Global Rise of the Smartphone". 
  5. ^ "IBM Worklight - United States". Retrieved 2013-10-09. 
  6. ^ "ThemeRoller". 
  7. ^ "JQuery Mobile Theming Overview". 
  8. ^ "More news from MS Open Tech: announcing the open source Metro style theme for jQuery Mobile". 

Further reading

External links

  • Official website
  • The jQuery Project
  • jQuery Mobile documentation and demo
  • jQuery Mobile Framework: write less, do more
  • jQuery Mobile C# ASP.NET By Matthew David Elgert
  • PropertyCross, Helping you select a cross-platform mobile framework: jQuery Mobile
This article was sourced from Creative Commons Attribution-ShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for and content contributors is made possible from the U.S. Congress, E-Government Act of 2002.
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a non-profit organization.

Copyright © World Library Foundation. All rights reserved. eBooks from Project Gutenberg are sponsored by the World Library Foundation,
a 501c(4) Member's Support Non-Profit Organization, and is NOT affiliated with any governmental agency or department.