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...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

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