문제

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