Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery and jQueryMobile or either one?

It will be great if some can suggest weather or not to use jQuery for mobile web application for low bandwidth, also need to know if both jQuery and jQueryMobile will be needed or I can just use jQueryMobile for mobile web applications.

Thanks

like image 694
Pawan Avatar asked Dec 28 '22 06:12

Pawan


2 Answers

jQuery Mobile is not a standalone library. It requires jQuery http://jquerymobile.com/download/

Use these minified cdn links would be good

<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.css" />
<script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script src="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.js"></script>

And jQuery Mobile team constantly work on performance with almost each release

enter image description here

And if you are more concerned on speed. Then jQuery Mobile has decoupled it's library in modules so you can only use what interaction you want.

And soon jQuery Mobile is going to release a download builder for this

Download builder: In the works

Now that we’ve decoupled most of the UI widgets, we’ve set the stage for there to be a download builder. This will let you build a custom version of jQuery Mobile to only include the parts you need. For example, you could just use the core files to add Ajax-based navigation with pushState and leverage some of the touch events and other utilities with a very lightweight build (roughly 10k). Or, you could add in specific UI widgets like form elements, listviews, etc. to create an optimized build. We’re aiming to have a download builder tool launch as part of 1.0 final in some form. We’re working on a dependency map now for all the plugins to support this tool.

Until the Download Builder is released you can always head over to Github and download the decoupled widget: https://github.com/jquery/jquery-mobile/tree/master/js

like image 111
Jitendra Vyas Avatar answered Jan 08 '23 23:01

Jitendra Vyas


jQuery Mobile is not a complete library, you will need jQuery 1.6.4.

jQuery Mobile is lightweight, and you can get a minified version which will be smaller in size. You should also look in to using a CDN for your library, like so:

<script src="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.js"></script>

Instead of:

<script src="jquery.mobile-1.0.1.min.js"></script>

If you did't know, a CDN stands for Content Delivery Network, meaning the JQ library is hosted elsewhere, like on a Google or jQuery server, and delivered to your application. This way, if the user has already downloaded/used the library before, while browsing other websites, they won't have to download the library again. The benefits of this are better caching and decreased latency.

like image 33
ShadowStorm Avatar answered Jan 08 '23 23:01

ShadowStorm