简体   繁体   English

在新标签页或窗口中打开网址

[英]Open url in new tab or window

I want that when users open my web site a new window or tab will be open after 10 sec, I found this function window.open("yoururl") but it seems that it only work on click event so how can I make it work without a click event 我希望当用户打开我的网站时,一个新的窗口或选项卡将在10秒后打开,我发现了此函数window.open(“ yoururl”),但它似乎仅在click事件上起作用,因此我如何使其起作用没有点击事件

jQuery(document).ready(function(){

  setTimeout('openUrl()',10000);

})

function openUrl() {
 window.open("yoururl");
}

It is not permitted to open new window by using any event that is not triggered by user action . 不允许通过使用不是由用户操作触发的任何事件来打开新窗口。 Some sites trick the users in clicking something else and then making use of that action to do popup. 一些网站诱使用户单击其他内容,然后利用该操作进行弹出。 But it is unacceptable and truly annoying user experience. 但这是不可接受的,并且确实令人讨厌。

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

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