I’m looking for a solution to call a controller method/action inside an external js-file, not inside html-file!
so I have a test.js file, which has a ajax call and I want to let play create the url like:
$.ajax({
type: 'post',
url: "#{@Application.sendMail();/}", //i know it's not the right syntax but something like this
.......
});
so I don’t know how this works. thanks for your suggestions!
cheers,
Marco
js files are static files so it is not a good practice to put variables inside because you then loose browser and server caching.
In such a situation it is better to create a function in your js and call it from your html with the url as an argument