Passing parameters to a page-id in jQuery Mobile

Yes, parameters on the hash are not supported by default. I’ve been using the following plugin to give me that, and it’s been working pretty good so far 😉 jqm.page.params UPDATE – HOW TO USE: I’ve added the following code after including jqm.page.params.js: $(document).bind(“pagebeforechange”, function( event, data ) { $.mobile.pageData = (data && data.options && … Read more

jQuery Mobile: Sending data from one page to the another

One HTML / multiple pages template Here’s an example of passing an attribute from listview to the second page in 1 html multi page template: http://jsfiddle.net/Gajotres/Gv7UW/ – js object as a storage container http://jsfiddle.net/Gajotres/J9NTr/ – localStorage as a storage container Basically what you want to do is create a persistent javascript object for a storage … Read more

Is there any way to check reachability test of server in jQuery

To test if your server is up you will need to connect to it and check status massage: $.ajax(‘LINK GOES HERE’, { statusCode: { 404: function() { alert(‘Not working’); }, 200: function() { alert(‘Working’); } } }); Working jsFiddle example: http://jsfiddle.net/Gajotres/PMrDn/47/ $.ajax({url: “http://api.themoviedb.org/2.1/Movie.search/en/json/23afca60ebf72f8d88cdcae2c4f31866/The Goonies”, dataType: “jsonp”, statusCode: { 200: function (response) { alert(‘status 200’); }, … Read more

How to inject the same panel into multiple pages using jquery mobile

jQuery Mobile >= 1.4 Solution one: Use an External panel that can be accessed from any page, this is in case you want to have the same panel contents in all pages. Append panel to $.mobile.pageContainer once only on pagebeforecreate and then enhance the panel using $(“.selector”).panel(). var panel=”<div data-role=”panel” id=”mypanel” data-position=”right” data-display=”push”><h1>Panel</h1><p>stuff</p></div>”; $(document).one(‘pagebeforecreate’, function … Read more

How to upload file with Phonegap and JqueryMobile?

You can’t use input file on Phonegap. It’s not supported. You need make something like this: function onDeviceReady() { // Retrieve image file location from specified source navigator.camera.getPicture(uploadPhoto, function(message) { alert(‘get picture failed’); }, { quality: 50, destinationType: navigator.camera.DestinationType.FILE_URI, sourceType: navigator.camera.PictureSourceType.PHOTOLIBRARY } ); } function uploadPhoto(imageURI) { var options = new FileUploadOptions(); options.fileKey=”file”; options.fileName=imageURI.substr(imageURI.lastIndexOf(“https://stackoverflow.com/”)+1)+’.png’; options.mimeType=”text/plain”; … Read more

What is the “mobile-pagecontainer” selector

$(“:mobile-pagecontainer”) is a selector, it refers to the parent element of jQM pages, both internal pages and external ones. By default, :mobile-pagecontainer is body. It also can be referred to as $.mobile.pageContainer (mind capital “C” in pageContainer). .pagecontainer() is a function that is used to change and load pages, as well as retrieve active page. … Read more