Get Updates about Tech News MuGhoTa !

How to open specific link in new tab on pageload

Many people on the web, search for How to open a specific link in a new tab on page load or How to open links in a new tab on click. Some of them also want to open their own site on a page. So we are sharing the most used scripts for open a link in the new tab.
How to open specific link in new tab on pageload Many people on the web, search for How to open a specific link in a new tab on page load or How to open links in a new tab on click. Some of them also want to open their own site on a page. So we are sharing the most used scripts for opening a link in the new tab.

How to open a specific link in a new tab on page load

There are scripts that you can use on your site or on any single page to open a link in a new tab on page load.
  • Open a link in the same tab on Page-Load
<body onload="window.open('https://www.abhishekindora.com/');">
  • Open a link in New Tab on page-load
<body onload="window.open('https://www.abhishekindora.com/', '_blank');">
  • Open or auto-refresh different URL in New Tab By using the meta tag.
<meta http-equiv="refresh" content="5;URL=javascript:window.open('https://www.abhishekindora.com/', '_blank');" />

How to open links in a new tab on click

There are scripts that you can use on your site or on any single page to open the link when the user clicks anywhere.
  • Add a single link to open when only clicking on the link
<a id="link" href="https://www.abhishekindora.com/" target="_blank">Abhishek Indora</a>
  • Open URL on click anywhere in new tab
<body onclick="window.open('https://www.abhishekindora.com/', '_blank');">

How To Auto-Refresh The URL By Meta tag

You can use these scripts if you want to automatically refresh the URL.
  • Refresh the same URL by using the meta tag.
<meta http-equiv="refresh" content="5" />
  • Refresh a different URL after 10 seconds
<meta http-equiv="refresh" content="10;URL='https://www.abhishekindora.com/'" />

Getting Info...

Post a Comment

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.