简体   繁体   English

打开新标签页-Google Chrome浏览器

[英]Open New Tab- Google Chrome

After reading this thread , I looked around my Google Chrome settings for how to allow javascript to open new tabs without user interaction but I couldn't find the setting. 阅读此主题后 ,我环顾了Google Chrome浏览器的设置,以了解如何允许javascript在没有用户交互的情况下打开新标签页,但找不到该设置。 I'm using Google Chrome on my iMac, if it makes a difference. 我会在iMac上使用Google Chrome(如果有所作为)。

I tried searching for something using the Chrome Support Site but couldn't find anything that really helped. 我尝试使用Chrome支持网站搜索某些内容,但找不到真正有用的内容。

Does anyone know how to edit this setting? 有人知道如何编辑此设置吗?

If I understood your question then, in your core javascript file you can add this: 如果我理解您的问题,则可以在您的核心javascript文件中添加以下内容:

$(document).ready(function () {
    $("a").click(function () {
        $(this).attr("target", "_blank");
    });
});

Fiddle. 小提琴。

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

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