Jump to content

Open a new tab in chrome?

- - - - -

  • Please log in to reply
1 reply to this topic

#1
liamzebedee

liamzebedee

    Programmer

  • Members
  • PipPipPipPip
  • 129 posts
How do you open a new tab in chrome using JS. It needs to open a specific url.

#2
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,118 posts
  • Location:Vancouver, Eh! Cleverness: 200
This is possible from a very early HTML standard, for example this link:
<a href="http://www.example.com" target="_blank">

The JS equivalent of the target will be the following:
<script type="text/javascript">
window.open("http://www.example.com", "_blank");
</script>

Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users