2

I have a page on my site with a popup div:

<div data-role="popup" id="MyPopup">
    <a href="#" data-rel="back" data-theme="a" data-icon="delete" 
      class="...">Close</a>
    <div id="Gaia_Ages_Content" class="...">
        <p>Oops! Could not find information for that item!</p>
    </div>
</div>

I use the .load method to display external HTML files in the popup:

$("MyPopup").load(_LoadUrl);

That much works just fine.

I have a handler for the "popupafterclose" event that resets the content of the popup to serve as an error message if the file to be loaded is not found:

$("MyPopup").on("popupafterclose",function(event, ui) {
    ...
    $thisPage_Popup.html('<div ... </div>');
});

This too works just fine.

What doesn't work is a second handler.

$("MyPopup").on("pagecontainerload",function(event, ui) {
    LinkExtTarget (_thisPage_Popup);
});

The point of this is to call a function that will force all external links to open in a new window. That function works when called elsewhere. The popupafterclose handler is triggered just when I expect it, and the function is executed properly. The pagecontainerload handler is NEVER triggered, and the external links are not handled as I thought they would be.

I'd appreciate any help.

Jim Fulton
  • 21
  • 1
  • do you mean to not have the `#` signs in your jquery calls i.e. `$('#MyPopup')` or is that a typo? – Jacob Mar 10 '15 at 22:39
  • Jacob, thanks for your attention. I simplified the above code to avoid distractions. Instead of “MyPopup”, the actual code is _thisPage_Popup = _hash + _thisPage_Id + _Popup; $thisPage_Popup = $(_thisPage_Popup); … $thisPage_Popup.on("popupafterclose",function(event, ui) {… All of the variables beginning with ‘_’ are globals. – Jim Fulton Mar 12 '15 at 17:38
  • I also don't know but I have been successful in rather using the "change" event ("pagecontainerchange"). – darwin Oct 27 '16 at 16:10

0 Answers0