-
Book Overview & Buying
-
Table Of Contents
jQuery Mobile Cookbook
By :
By default, the jQuery Mobile framework shows a spinning animation with theme a and without any text when loading a new page. If there is an error, the page load times out and an error message Error Loading Page is shown, with theme e. This recipe shows you how to change and customize the page loading and error messages.
Copy the full code of this recipe from the sources code/07/load-message folder. To try out this recipe, launch the simple nodejs web server that is available in the folder code, by using the following command:
node jqmserver.js
Then you can launch the code by using the URL: http://localhost:8080/07/load-message/main.hml.
In main.html, add the following script before including jquery.mobile.js:
$(document).bind("mobileinit", function() {
$.mobile.loadingMessage = "Fetching it...";
$.mobile.loadingMessageTextVisible = true;
$.mobile.loadingMessageTheme = "b";
$.mobile.pageLoadErrorMessage = "Oops...
Change the font size
Change margin width
Change background colour