I'm trying to add a button to an app that uses Crafty, but, unlike the other buttons, I want this one to redirect the user to a different URL.
Notice that no-one ever taught me how to use Coffee or JavaScript, so I'm really new.
I'm trying to use the redirection here:
cfg.onClickTeacher = ->
preloadScene(CFG.ASSETS_MAIN, -> "www.my-site/teacher")
But it's not working, so, what do I have to do?
That doesn’t involve Crafty, and is the same as in JavaScript.
cfg.onClickTeacher = ->
window.location.href = 'http://example.com/'
(Relative URLs work too.)