Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

8 years ago by cmysr

How to input hyperlink so when player collides with the exit, it will redirect to new tab on browser to a specific url?

Thanks!

8 years ago by KevMcKenzie

If i understand you correctly,
you mean like that?

var a = document.createElement('a');
a.href='http://www.impactjs.com';
a.target = '_self';
document.body.appendChild(a);
a.click();

or if you want a new tab:

var a = document.createElement('a');
a.href='http://www.impactjs.com';
a.target = '_blank';
document.body.appendChild(a);
a.click();
document.body.removeChild(a)
Page 1 of 1
« first « previous next › last »