Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery Mobile - Multiple popups issue
    primarykey
    data
    text
    <p>I'm having an issue in my jQuery Mobile site, I have 3 separate pages (within one index.html file), all which load their own popup on a success event, I'm then loading the popup via jQuery like:</p> <pre><code>$( "#myPopupDiv" ).popup( "open" ); </code></pre> <p>This works great, however once the user has visited a page and opened its popup, when visiting the subsequent pages, the popups on those pages then don't fire (however the popup on that page works for the duration of the session still), however all of the code works on the page and there are no console errors in Chrome dev tools.</p> <p>I don't have any duplicate ID's, I have tried putting in a console.log where the code should fire to open the popup, this works correctly, seemingly bypassing the code to open the popup. </p> <p>Has anyone experienced this issue before?</p> <p>Thanks in advance.</p> <p><strong>Simplified Code example</strong></p> <pre><code>&lt;!-- PAGE 1 --&gt; &lt;div data-role="page" id="page-1"&gt; &lt;div data-role="content"&gt; &lt;!-- BUTTON: loadPopup-1 --&gt; &lt;div id="popup-1" data-role="popup"&gt; &lt;!-- Popup contents --&gt; &lt;/div&gt;&lt;!-- /popup --&gt; &lt;/div&gt;&lt;!-- /content --&gt; &lt;/div&gt;&lt;!-- /page --&gt; &lt;!-- PAGE 2 --&gt; &lt;div data-role="page" id="page-2"&gt; &lt;div data-role="content"&gt; &lt;!-- BUTTON: loadPopup-2 --&gt; &lt;div id="popup-2" data-role="popup"&gt; &lt;!-- Popup contents --&gt; &lt;/div&gt;&lt;!-- /popup --&gt; &lt;/div&gt;&lt;!-- /content --&gt; &lt;/div&gt;&lt;!-- /page --&gt; &lt;!-- JS --&gt; function loadPopup-1() { $( "#popup-1" ).popup( "open" ); } function loadPopup-2() { $( "#popup-2" ).popup( "open" ); } </code></pre> <p>So if the user selects page 1 and opens its popup, that popup will continue to work however the one on page 2 will not, and vice-versa.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload