Examples are as follows:
$("#last").click(function(){var w=window.open();setTimeout(function(){w.location="//www.VeVB.COM";}, 1000);return false;});window.open is a javascript function. The function is to open a new window or change the original window. If you call the window.open() function directly in js to open a new window, the browser will intercept you. So how to avoid it? Interested friends can learn about this article may be helpful to your study.
window.open is a javascript function. The function is to open a new window or change the original window. However, it is generally used to open a new window. Because when modifying the original web page address, there can be another function, that is window.location, which can redirect the web page address and make the web page jump to another page.
What I want to talk about now are several strategies for using the window.open function. Generally speaking, if you call the window.open() function directly in js to open a new window, the browser will intercept you, thinking that you will pop up ads and other forms that the user does not want to get. So if you don't want the browser to intercept you, you can change this function to trigger when the user clicks, so that the browser thinks that the user wants to access this page, rather than popping it directly to the user.
Therefore, the commonly used method is to add onclick event to the hyperlink, such as <a href="javascript:void(0)" onclick="window.open()"></a>, so if the user clicks on this hyperlink, the browser will think that it is opening a new link, so it will not intercept it.
But sometimes we will encounter a window that wants to pop up, but it will pop up after the onckick event is executed, and it will be intercepted by the browser. We can avoid it by the following method, which is to use window.open to open a window and then modify the address. For example, var tempwindow=window.open('_blank'); open a window, and then use tempwindow.location='//www.VeVB.COM'; to make this window jump to Baidu, which will give the effect of popping up the Baidu window.
The above simple implementation code for window.open is not intercepted (recommended) is all the content I share with you. I hope you can give you a reference and I hope you can support Wulin.com more.