Friday, November 25, 2022

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 pageload or How to open links in a new tab on click. Some of them also want to open their own site on a page.

There are scripts that you can use on your site or on any single page to open a link 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 URLs in New Tab By using the meta tag.
<meta http-equiv="refresh" content="5;URL=javascript:window.open('https://www.abhishekindora.com/', '_blank');" />

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 the URL on click anywhere in the 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/'" />
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -

New Updates

Categories