gpt4 book ai didi

javascript - jquery mobile 中未打开弹出窗口

转载 作者:行者123 更新时间:2023-12-02 18:39:29 25 4
gpt4 key购买 nike

我已经实现了一个脚本来阻止我的 iPad 上的移动应用程序中的链接。

它工作正常,但我现在在使用 jquery mobile 时出现弹出窗口问题。

问题是当我使用这个脚本时,弹出窗口不再打开。

如何打开弹出窗口?

脚本:

 (function(document,navigator,standalone) {
// prevents links from apps from oppening in mobile safari
// this javascript must be the first script in your <head>
if ((standalone in navigator) && navigator[standalone]) {
var curnode, location=document.location, stop=/^(a|html)$/i;
document.addEventListener('click', function(e) {
curnode=e.target;
while (!(stop).test(curnode.nodeName)) {
curnode=curnode.parentNode;
}
// Condidions to do this only on links to your own app
// if you want all links, use if('href' in curnode) instead.
if('href' in curnode && ( curnode.href.indexOf('http') ||
~curnode.href.indexOf(location.host) ) ) {
e.preventDefault();
location.href = curnode.href;
}
},false);
}
})(document,window.navigator,'standalone');

最佳答案

在这种情况下,您需要以编程方式打开它。

$('#popupID').popup('open');

关于javascript - jquery mobile 中未打开弹出窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16972940/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com