Вопрос

So, this is my code:

function link1() { window.location.href="Example"; }

How do i achieve the _blank function in JS?

Cheers

(Note: I am not using a library, nor am i intending to atm)

Это было полезно?

Решение

window.open will do the trick.

function link1()
{ 
   window.open("http://www.example.com");
}
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top