为什么pagecontainer加载事件不起作用?

时间:2015-03-10 22:26:13

标签: jquery jquery-mobile-popup

我的网站上有一个带弹出窗口的页面:

<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>

我使用.load方法在弹出窗口中显示外部HTML文件:

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

这很好用。

我有一个处理器,用于&#34; popupafterclose&#34;如果找不到要加载的文件,则重置弹出窗口内容的事件将作为错误消息:

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

这也很好用。

什么不起作用是第二个处理程序。

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

重点是调用一个强制所有外部链接在新窗口中打开的函数。该功能在其他地方调用时有效。 popupafterclose处理程序在我预期的时候被触发,并且函数正确执行。 pagecontainerload处理程序永远不会被触发,外部链接不会像我想象的那样处理。

我很感激任何帮助。

0 个答案:

没有答案