admin管理员组文章数量:1416050
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?
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?
Share Improve this question edited Aug 14, 2013 at 15:47 Ry-♦ 226k56 gold badges493 silver badges499 bronze badges asked Aug 14, 2013 at 15:44 SascuashSascuash 3,85111 gold badges49 silver badges67 bronze badges1 Answer
Reset to default 6That doesn’t involve Crafty, and is the same as in JavaScript.
cfg.onClickTeacher = ->
window.location.href = 'http://example./'
(Relative URLs work too.)
本文标签: javascriptRedirect to URL from CoffeeScriptStack Overflow
版权声明:本文标题:javascript - Redirect to URL from CoffeeScript - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745248156a2649657.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论