title: Popups common to all pages in jQuery Mobile site
body: <p>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 <a href="http://jquerymobile.com/demos/1.2.0-alpha.1/docs/pages/page-anatomy.html" rel="nofollow">multi-page feature</a>).</p>
  
  <p>The site is going to have some popups for notifications, and they are going to look the same on all pages. I am implementing the popups using their <a href="http://jquerymobile.com/demos/1.2.0-alpha.1/docs/pages/popup/index.html" rel="nofollow">new popup feature</a> which seems designed for this purpose. I can easily implement this by putting copies of the popups on each of the pages but this will create a lot of redundant code which may be hard to maintain. I can probably make my server insert the code for me in the proper places but that seems complex and inefficient.</p>
  
  <p>I tried putting the popups outside of the pages and they do not work reliably (you can see an example <a href="http://eliasz.net/jQueryMobilePopupTest/jQueryMobilePopupTest1.html" rel="nofollow">here</a>).</p>
  
  <p>I tried dynamically generating them by using a templating system (the one built into underscore.js) but that looks like it may cause problems – I will have to destroy every popup when it is closed to avoid memory leaks.</p>
  
  <p>I am not sure if this is a bug in the popup widget, which seems likely since the popup widget is only in an alpha version of jQuery Mobile.</p>
  
  <p>Does anyone here have any ideas as to how to make a site with many pages in several html files, with a few popups that are common to all of the pages?</p>