Jump to content

Open url in a new new tab Safari


andrei.nicolae
 Share

Recommended Posts

Hi guys,

I've tried multiple solutions found online opening a new tab when a button is hit.

    buyBtn.on('pointerdown', function (event){
        openWindow(myurl);
    }, this);

 

function openWindow(url) {
var result = window.open(url,  "_blank")
}

function openWindow(url) {
  document.getElementById('newlink').href = url;
  document.getElementById('newlink').click();
}

function openWindow(url) {
window.location.assign(url);
}

This are some of them. All of these solutions work on other browsers, but not on Safari.

Does anyone have a working solution for Phaser3?

Thank you.

Link to comment
Share on other sites

14 hours ago, rich said:

Like this:

http://labs.phaser.io/view.html?src=src\input\dom events\add up callback.js

It needs specific handling so that the callback is executed in the event handler. Look at the docs for this.input.addUpCallback because they're extensive and explain how to use it and what to look out for.

Thanks for the solution. Works like a charm, for future users that have this problem, add a callback inside the button touch/click event.

Link to comment
Share on other sites

  • 2 years later...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...