How to redirect a user with javascript while using ratchet?

240 Views Asked by At

Normally to redirect a user in a website using javascript I'd use window.location.replace("newpage.html"); however I've found that when using Ratchet this doesn't work. Does anyone know of a good way to make a ratchet application change pages using javascript?

1

There are 1 best solutions below

0
On BEST ANSWER

Take a look at push.js to see how the navigation mechanism is triggered. Ratchet auto-wires navigation to elements triggered on the touchend event. You can call PUSH with those properties directly.

PUSH({
  url        : "target.html",
  hash       : "#",
  timeout    : null,
  transition : "slide-in"
});