jQuery单击_blank [英] jQuery click _blank
本文介绍了jQuery单击_blank的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在你们的帮助下,我现在有了一个像魅力一样的脚本..我现在唯一需要的是在新标签/窗口中打开URL的脚本。
With help from you guys I now have a script that works like a charm.. The only thing I need now, is the script to open the URL in a new tab/window.
$(document).ready(function() {
$("#onskeliste li").click(
function()
{
window.location = $(this).attr("url");
return false;
});
$('#onskeliste li a').click(function(e) {
e.stopPropagation();
});
})(jQuery);
你能帮我解决这个问题吗? : - )
Can you help me with this?? :-)
推荐答案
你应该使用 window.location
而不是 window.open()
打开一个新窗口(或标签页)而不是加载当前的URL。
Instead of using window.location
you should use window.open()
to open a new window (or tab) instead of loading the URL in the current one.
这篇关于jQuery单击_blank的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文