jQuery Mobile

Menu Search

Version Demos

Using the same popup across multiple pages

You can reuse the same popup on multiple pages if you declare it as a direct child of the body element. It can then appear on any page in the document.

If you define the popup outside of any page, then you must take care to instantiate the popup widget yourself. You can do this as early as DOMReady, because the popup is not on any page.

The example below illustrates the setup with two pages.

Menu

Pages loaded via Ajax

When your application consists of multiple HTML documents containing single jQuery Mobile pages linked together via Ajax navigation, you can still use a single popup across multiple pages, however, since any of your documents may serve as the start page, you must include the code that initializes the popup as well as the markup for the popup itself in all documents. The external widgets demo explains further and provides an example of such a structure.

Menu

Another Page

This is another page that can be reached using the links in the global menu.

Menu

Third Page

This is a third page that can be reached using the links in the global menu.