2014-02-25 114 views
0

我有一个简单的页面打开手机浏览器的新选项卡的锚标记

<script> 
function hello(){ 

    alert("loaded");    
    url="https://yahoo.com"; 
    window.open("http://www.google.com"); 

} 
</script> 
<a href="hello()" id="ab">two</a> 

我的本意是,我希望它在新标签中打开。我无法触及现有函数hello,因为它是用客户应用程序编写的。有什么办法可以打开。 _blank在这种情况下不起作用。其特定的移动浏览器。它适用于桌面浏览器。 任何帮助表示赞赏。

回答

0

也许你可以创建一个HTML文件,执行该功能并在新窗口中打开它。

<a href="hello.html" target="_blank" id="ab">two</a> 

hello.html的:

<body onload="hello()"> 
<script> 
function hello(){ 

alert("loaded");    
url="https://yahoo.com"; 
window.open("http://www.google.com"); 

} 
</script> 
</body> 
+0

网址是动态的,这是得到由未知参数的数量产生 –

相关问题