繁体   English   中英

在phonegap中打开window.open

[英]window.open in phonegap

我是Phonegap的新手。 我在IOS上使用phonegap。 我面临的问题是,JS函数window.open('URL')无法正常工作。 它什么也没有。 谁能帮我实际发生的事情?

谢谢

试试这个: window.location ='http://www.google.com';

window.location.href ='http://www.google.com';

要显示确认框,您需要执行以下操作

//process the confirmation dialog result
function onConfirm(button) {
alert('You selected button ' + button);
}

// Show a custom confirmation dialog
//
function showConfirm() {
navigator.notification.confirm(
    'You are the winner!',  // message
    onConfirm,              // callback to invoke with index of button pressed
    'Game Over',            // title
    'Restart,Exit'          // buttonLabels
);
}

只需单击按钮即可调用showConfirm()...

我使用具有弹出过渡的简单页面,因为jquery对话框也可以用作页面,但是它会影响您的CSS,这就是为什么我使用具有弹出过渡的简单页面的原因。 并且它附加在当前DOM中,由于该原因,我可以访问上一页页面。 就像Opener解决Window.open()问题一样

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM