I am trying to make a site using jQuery Mobile. It consists of many pages in HTML files, some of which have only one page, and some of which have several pages (using their
May be very late to the party, but may be useful for someone coming across.
Now you can use Global Popups if you are using latest JQM (I am using JQM 1.4.2). You just need to declare the popup directly under body div, out side all data-role pages.
Better go through this JQM documentation
I've seen your request on jQuery Mobile github, and posted a solution that I'm using on my web applications. Check http://ghita.org/jquery/dynamic-mobile-popup it's a small plugin that allows you to have dynamic popups, it let you focus on the content of the popup and the events.
Include the plugin (has 1.8kb), and then call:
$.dynamicPopup({content: 'This is the dynamic content of the popup.'});
content - can be a string or a jQuery html object.
Check https://github.com/serbanghita/jQM-dynamic-popup for the full list of options, some of which are inherited from jQuery's mobile popup() function.
This problem was a show stopper for me because I have dynamic webpages and I don't care of manually injecting HTML content for the popup() to be active. Hope you find it helpful.
you would have to try and set it up like the jqm loader, which also resides outside of the div.page (otherwise you would have one loader per page inside the dom), so i think the right approach would be to not include the popup within a page, but outside the div.page.
as jqm will only pull in div.pages and nothing before/after you should be able to include a generic popover on every page and only have it in the dom once. not sure this is working though outside div.page.