Reputation: 20460
I use the "jsAction" tag to generate ajax url in play framework:
var addToFriendURL = #{jsAction @users.addToFriend(':friendId') /}
The code works fine in html template inside a tag,but i found it's invalid in a external javascript file which i include in the html template.
What was happened when i move the code to a external javascript file ?
Upvotes: 0
Views: 413
Reputation: 54924
Once it is moved to javascript file, it becomes statically served content that the Play server does not parse. Therefore, you have a few options
Personally I would go with option 2, but it may depend on your requirements.
Upvotes: 1