-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
jQuery Mobile Cookbook
By :
The jQuery Mobile framework does not track dialogs in history. A dialog will thus not reappear when you click on the back button of your browser. Using a dialog for some features, for example to show an error pop up or an alert, has a minor issue that is very visible. When the dialog is opened from a page, the address bar will show the page URL suffixed with the #&ui-state=dialog text. This might not be desirable to all. This recipe shows you how to use the History API and customize a regular dialog to appear, such as a pop up without any changes to the URL, making use of the History API.
Copy the full code of this recipe from the code/02/history sources folder. You can launch this code using the URL http://localhost:8080/02/history/main.html.
The steps to be followed are:
Create main.html, and add a link to open the errordialog.html file as a dialog. Also add an input button, as shown in the following code snippet...
Change the font size
Change margin width
Change background colour