获取链接以在Android 2的新窗口中打开 [英] Getting a link to open in a new window on Android 2

查看:100
本文介绍了获取链接以在Android 2的新窗口中打开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用jquerymobile HTML等,Android3,4有标签浏览,所以当我用 target =_ blank标记链接时,它们会在新窗口中打开,但在Android 2上它会打开不起作用。它实际上是否有位置?



这是否则用户在返回应用程序时必须重新开始重新操作lol

解决方案

试试这样:

 < script type =text / javascript> 
$(document).ready(function(){
var url; $ b $ url url = $(a)。attr('href');
$(a ).attr(onclick,window.open('+ url +'); return false;);
});
< / script>


Using jquerymobile HTML etc, Android3,4 have tabbed browsing so when I mark my links up with target="_blank" they open in new window but on Android 2 it doesn't work. Is it actually posibble?

It's just otherwise the user when returning to the app has to start all over again lol

解决方案

Try something like this:

<script type="text/javascript">
  $(document).ready(function() {
    var url;
    url = $("a").attr('href');
    $("a").attr("onclick", "window.open('"+url+"'); return false;");
  });
</script>

这篇关于获取链接以在Android 2的新窗口中打开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆