1

我正在创建一个网络应用程序,并且我有一个 jquery 函数来打开一个链接:

window.open(_url, "_self", 'width=800, height=600'); 

这适用于浏览器,但不适用于 Intel XDK。window.open 不能在 Web 应用程序上运行吗?

提前感谢您的帮助

4

2 回答 2

1

使用_blank而不是_self,这将打开一个带有应用程序(InApp-browser)的弹出窗口,这是一个工作示例代码:

<!DOCTYPE html>
<html>
<head>
    <title>Window.open</title>
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0;" />
    <script src="cordova.js"></script>
    <script>
        function openwin(){
            window.open('http://intel.com', '_blank', '');
        }
    </script>        
</head>
<body> 
    <button onclick="openwin()">window open</button>
</body>
</html> 
于 2014-03-13T17:12:50.313 回答
0

_system在 Android 上打开可以本地处理的链接时, 我不得不使用,例如 mapUrl = 'http://maps.google.com/maps?daddr=...&saddr=...', window.open(encodeURI(mapsUrl), '_system');

我得到一个Your ... app has stopped working message.否则。

于 2014-04-19T16:40:30.103 回答