Skell Posted June 25, 2014 Share Posted June 25, 2014 Prompt method Open link in a new browser tab (that you use in your html5 games)? document.location.href = url; - bad, page opens in the current tab. window.open(url, '_blank');- bad, require browser permission. Link to comment Share on other sites More sharing options...
lewster32 Posted June 25, 2014 Share Posted June 25, 2014 You're doing it the right way; unfortunately that's also one of the many ways popups are generated, so it's generally restricted so that an actual link element with target="_blank" (or a button or other purposely interactive element) must be clicked in order to stand a chance of working. The best workaround I can think of is to use a clickable html <a> element positioned above the game canvas. Link to comment Share on other sites More sharing options...
Skell Posted June 25, 2014 Author Share Posted June 25, 2014 The best workaround I can think of is to use a clickable html <a> element positioned above the game canvas. Thanks for your answer. I read on the Internet that use the <div> element with tag "a" . Probably this is the only solution (without restrictions). ----- Maybe someone else knows another solution, it would be interesting. Link to comment Share on other sites More sharing options...
lewster32 Posted June 25, 2014 Share Posted June 25, 2014 A <div> is fine but not necessary if you add display: block to the CSS of the <a> tag. Link to comment Share on other sites More sharing options...
Recommended Posts