DEV Community ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป

How to redirect to URL in new tab On window load event๐ŸŠ

Top comments (2)

Collapse
 
hozefaj profile image
Hozefa • Edited on

Making sure when cross linking to another site for security reasons its better to add rel="noopener" or rel="noreferrer" would be good.

In this example, it can be like

var windowFeatures = "rel='noopener noreferrer'";

window.open("https://atulprajapati.in", '_blank', windowFeatures)

reference docs:

  1. developer.mozilla.org/en-US/docs/W...
  2. web.dev/external-anchors-use-rel-n...
Collapse
 
atulcodex profile image
๐Ÿšฉ Atul Prajapati ๐Ÿ‡ฎ๐Ÿ‡ณ

Thanks ๐Ÿ’ brother, it's something new for me ๐Ÿ˜

๐Ÿ‘‹ Hey, my name is Noah and Iโ€™m the one who set up this ad. My job is to get you to join DEV, so if you fancy doing me a favor, Iโ€™d love for you to create an account.

If you found DEV from searching around, here are a couple of our most popular articles on DEV: