JQuery Mobile
{{Short description|JavaScript library}}
{{lowercase title}}
{{Infobox software
| name = jQuery Mobile
| logo = 220px
| author =
| developer = [https://jquery.org/team/ The jQuery Team]
| released = {{release date|2010|10|16}}{{cite web|author=jQuery Foundation - jquerymobile.com |url=https://blog.jquerymobile.com/2010/10/16/jquery-mobile-alpha-1-released/ |title=jQuery Mobile Alpha 1 Released |publisher=blog.jquerymobile.com |date=2010-10-16 |accessdate=2014-05-22}}
| latest release version = 1.4.5
| latest release date = {{release date|2014|10|31}}
| latest preview version = 1.5.0-rc1
| latest preview date = {{release date|2018|09|10}}
| programming language = JavaScript
| platform = See Mobile browser support
| genre = Mobile application framework
| license = MIT{{cite web
|author=jQuery Foundation - jquery.org
|url=https://blog.jquery.com/2012/09/10/jquery-licensing-changes/
|title=jQuery Licensing Changes
|publisher=Blog.jquery.com |date=2012-09-10 |accessdate=2013-10-09
}}
| website = {{url|https://jquerymobile.com/}}
| size = 351 KB / 142 KB (minified) / 40 KB (minified, gzipped)
}}
jQuery Mobile is a touch-optimized web framework (also known as a mobile framework), specifically a JavaScript library, developed by the jQuery project team. The development focuses on creating a framework compatible with many smartphones and tablet computers,{{cite web|title=Mobile Graded Browser Support|url=https://jquerymobile.com/gbs/}} made necessary by the growing but heterogeneous tablet and smartphone market.{{cite web|url=http://gigaom.com/2010/04/30/the-global-rise-of-the-smartphone/|title=The Global Rise of the Smartphone|access-date=2011-04-27|archive-date=2018-06-17|archive-url=https://web.archive.org/web/20180617042807/https://gigaom.com/2010/04/30/the-global-rise-of-the-smartphone/|url-status=dead}} The jQuery Mobile framework is consistent with other mobile app frameworks{{Cite web|url=http://www.htmlpanda.com/blog/why-jquery-mobile-is-suitable-for-mobile-web-app-development/|title=Resons why jQuery Mobile Is Suitable For Mobile Web App Development}} and platforms such as PhoneGap, Worklight,{{cite web|url=http://www.worklight.com |title=IBM Worklight - United States |publisher=Worklight.com |date= |accessdate=2013-10-09}} etc.
As of October 7, 2021 jQuery Mobile has been deprecated.{{cite web| url = https://blog.jquery.com/2021/10/07/jquery-maintainers-continue-modernization-initiative-with-deprecation-of-jquery-mobile//| title = jQuery maintainers continue modernization initiative with deprecation of jQuery Mobile|access-date=6 December 2022|publisher=jQuery Blog}}
Features
- Compatible with all major desktop browsers as well as all major mobile platforms, including Android, iOS, Windows Phone, Blackberry, WebOS, Symbian.
- 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 create semantic URLs through pushState.
- UI widgets that are touch-optimized and platform-agnostic.
Example usage
$('div').on('tap', function(event){
alert('element tapped ');
});
$(document).ready(function(){
$('.myList li').on('click touchstart', function() {
$('.myDiv').slideDown('500');
});
});
A basic example
What follows is a basic jQuery Mobile project utilizing HTML5 semantic elements. 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).
A screen of the project is defined by a section
HTML5 element, and data-role
of page
. Note that data-role
is an example of the HTML5 data
attribute, in this case being defined by jQuery Mobile. A page may have header
and footer
elements with data-role
of header
and footer
, respectively. In between, there may be an article
element, with a role
of main
and a class
of ui-content
. Lastly, a nav
element, with data-role
of navbar
may be present.
One HTML document can contain more than one section
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 1 Header
Hello, world!
Page 1 Footer
Page 2 Header
Example Page
Page 2 Footer
{{Clear}}
Theming
jQuery Mobile provides a theming framework that allows developers to customize color schemes and certain CSS aspects of UI features. Developers can use the jQuery Mobile ThemeRoller{{cite web|url=https://jquerymobile.com/themeroller/|title=ThemeRoller}} application to customize these appearances and create 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.{{cite web|url=https://jquerymobile.com/test/docs/api/themes.html|title=JQuery Mobile Theming Overview}}
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 two different color swatches, named "a" and "b". Here is an example of how to create a toolbar with the "b" swatch:
Page Title
(Source: from the jQuery Mobile website)
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.{{cite web|url=http://blogs.msdn.com/b/interoperability/archive/2012/04/26/more-news-from-ms-open-tech-announcing-the-open-source-metro-style-theme.aspx|title=More news from MS Open Tech: announcing the open source Metro style theme for jQuery Mobile|archive-url=https://web.archive.org/web/20140816185609/http://blogs.msdn.com/b/interoperability/archive/2012/04/26/more-news-from-ms-open-tech-announcing-the-open-source-metro-style-theme.aspx |archive-date=2014-08-16 |url-status=dead}} 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
class="wikitable sortable" style="table-layout: fixed; width: 105%; text-align: center" |
style="width:64pt;" rowspan="2"| Platform
! style="width:44pt;" rowspan="2"| Version ! style="width:35pt;" rowspan="2"| Native ! Phone Gap ! colspan="3" | Opera Mobile ! colspan="2" | Opera Mini ! colspan="2" | 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 |
rowspan="3" | iOS
| v2.2.1 | {{good|A}} | {{good|A}} | | | | | | | | | |
v3.1.3, v3.2
| {{good|A}} | {{good|A}} | | | | | {{good|A}} | | | | |
v4-7.0
| {{good|A}} | {{good|A}} | | | | | {{good|A}} | | | | |
rowspan="2" | Symbian S60
| v3.1, v3.2 | {{good|A}} | | {{good|A}} | | {{good|A}} | {{good|A}} | {{good|A}} | | | {{bad|C}} | {{bad|C}} |
v5.0
| {{bad|C}} | {{bad|C}} | {{bad|C}} | | {{good|A}} | {{bad|C}} | {{good|A}} | | | | |
rowspan="2" | Symbian UIQ
| v3.0, v3.1 | | | {{bad|C | | | | | | | {{bad|C}} | |
v3.2
| | | | {{bad|C}} | | | | | | {{bad|C}} | |
Symbian Platform
| v.3.0 | {{good|A}} | | | | | | | | | | |
rowspan="4" | BlackBerry OS
| v4.5 | {{bad|C}} | | | | | {{bad|C}} | {{bad|C}} | | | | |
v4.6, v4.7
| {{bad|C}} | {{bad|C}} | | | | {{bad|C}} | {{okay|B}} | | | | |
v5.0
| {{okay|B}} | {{good|A}} | | | | {{bad|C}} | {{good|A}} | | | | |
v6.0
| {{good|A}} | {{good|A}} | | | | | {{good|A}} | | | | |
rowspan="3" | Android
| v1.5, v1.6 | {{good|A}} | {{good|A}} | | | | | | | | | |
v2.1
| {{good|A}} | {{good|A}} | | | | | | | | | |
v2.2
| {{good|A}} | {{good|A}} | | | {{good|A*}} | | {{bad|C*}} | | {{good|A*}} | |
rowspan="3" | Windows Mobile
| v6.1 | {{bad|C}} | | {{bad|C}} | {{bad|C}} | {{bad|C}} | {{okay|B}} | {{bad|C}} | {{okay|B}} | | | {{bad|C}} |
v6.5.1
| {{bad|C}} | | {{bad|C}} | {{bad|C}} | {{good|A}} | {{good|A}} | {{bad|C}} | {{good|A}} | | | |
v7.0
| {{good|A}} | | | | {{good|A}} | {{bad|C}} | {{good|A}} | | | | |
webOS
| 1.4.1 | {{good|A}} | {{good|A}} | | | | | | | | | |
bada
| 1.0 | {{good|A}} | | | | | | | | | | |
Maemo
| 5.0 | {{okay|B}} | | | | {{okay|B}} | | | {{bad|C}} | {{okay|B*}} | | |
MeeGo
| 1.1* | {{good|A*}} | | | | {{good|A*}} | | | | {{good|A*}} | | |
Key:
- {{Font color|#00ff99|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.
- {{Font color|#FF9B0A|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.
- {{Font color|#D80700|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.
See also
{{Portal|Free and open-source software}}
References
{{Reflist}}
Further reading
{{Refbegin}}
- {{cite book
| first = Matt
| last = Doyle
| date = March 18, 2014
| title = Master Mobile Web Apps with jQuery Mobile
| publisher = Elated Books
| edition = 4th
| page = 567
| isbn = 978-0-9873115-3-5
| url = http://store.elated.com/
}}
- {{cite book
| first = Jeff
| last = Pelletier
| date = April 25, 2013
| title = Mobile App Manual: The Blueprint
| publisher = Withinsight Publishing
| edition = 1st
| page = 96
| isbn = 978-0989072106
| url = http://mobileappmanual.com
}}
- {{cite book
| first = Giulio
| last = mann
| date = June 23, 2011
| title = jQuery Mobile First Look
| publisher = Packt Publishing
| edition = 1st
| page = 216
| isbn = 1-84951-590-5
| url = http://www.packtpub.com/tagged-vivo_mobile-first-look/book
}}
- {{cite book |first = Jon
|last = Reid
|date = July 7, 2011
|title = jQuery Mobile
|publisher = O'Reilly Media
|edition = 1st
|page = [https://archive.org/details/jquerymobile00reid_0/page/130 130]
|isbn = 1-4493-0668-3
|url = https://archive.org/details/jquerymobile00reid_0/page/130
}}
- {{cite book |first = Matthew
|last = David
|date = September 21, 2011
|title = HTML5 Mobile Websites: Turbocharging HTML5 with jQuery Mobile, Sencha Touch, and Other Frameworks
|publisher = Focal Press
|edition = 1st
|page = [https://archive.org/details/html5mobilewebsi0000davi/page/250 250]
|isbn = 0-240-81813-X
|url = https://archive.org/details/html5mobilewebsi0000davi/page/250
}}
- {{cite book
| first = Brad
| last = Broulik
| date = November 30, 2011
| title = Pro jQuery Mobile
| publisher = Apress
| edition = 1st
| page = 350
| isbn = 1-4302-3966-2
| url = http://www.apress.com/mobile/ios/9781430239666
}}
- {{cite book
| first = Steven E.
| last = Holzner
| date = January 2, 2012
| title = Sams Teach Yourself jQuery Mobile in 10 Minutes
| publisher = Sams
| edition = 1st
| page = 240
| isbn = 0-672-33557-3
| url = http://www.pearsonhighered.com/educator/product/Sams-Teach-Yourself-jQuery-Mobile-in-10-Minutes/9780672335570.page
}}
- {{cite book
| first = Maximiliano
| last = Firtman
| date = January 31, 2012
| title = jQuery Mobile: Up and Running
| publisher = O'Reilly Media
| edition = 1st
| page = 250
| isbn = 1-4493-9765-4
| url = http://shop.oreilly.com/product/0636920017.do
}}
- {{cite book
| first = Phill
| last = Duttson
| date = July 13, 2012
| title = Sams Teach Yourself jQuery Mobile in 24 Hours
| publisher = Sams
| edition = 1st
| page = 475
| isbn = 0-672-33594-8
| url = http://www.informit.com/title/0672335948
}}
- {{cite book
| first = Dutson, Phillip
| last = de Jonge, Adriaan
| date = November 2, 2012
| title = jQuery, jQuery UI, and jQuery Mobile: Recipes and Examples
| publisher = Addison-Wesley Professional
| edition = 1st
| page = 400
| isbn = 978-0-321-82208-6
| url = http://www.informit.com/title/0321822080
}}
{{Refend}}
External links
- {{Official website|https://jquerymobile.com/}}
- [https://jquery.org/ The jQuery Project]
- [https://demos.jquerymobile.com/1.0/ jQuery Mobile documentation and demo]
- [https://web.archive.org/web/20120321094122/http://www.mobicules.com/html5/jquery-mobile-framework-write-less-do-more/ jQuery Mobile Framework: write less, do more]
- [http://jquerymobile.codeplex.com/ jQuery Mobile C# ASP.NET By Matthew David Elgert] {{Webarchive|url=https://web.archive.org/web/20140705135444/http://jquerymobile.codeplex.com/ |date=2014-07-05 }}
- [https://archive.today/20140228104452/http://propertycross.com/jquerymobile/ PropertyCross, Helping you select a cross-platform mobile framework: jQuery Mobile]
{{Authority control}}
{{DEFAULTSORT:JQuery Mobile}}