Play Framework - Using Javascript Variable in Scala Template

江枫思渺然 提交于 2019-11-28 10:12:48

You can insert the relative URL in place of '@routes.Application....etc'

So for example "/function/" + fadeID

If the route of @routes.Application.function is /function

biesior

You can not mix Scala variables (server-side) with JS variables (client-side) as they are generated in quite distant environments.

Instead you can use for an example Play's javascriptRoutes like described in other question

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!