For my public files, I usually use:
@routes.Assets.at("data/table.txt")
in regular html
However, I have a javascript with the variable link
var file = "table.txt"//This changes depending on the code
var link = "data/"+ file;
And would like to run some jquery function like this
$('#mydiv').CSVToTable(@routes.Assets.at(link))
But this does not work. My questions
- Why does play use @routes.Assets.at? is it more secure in some way? it just seems to prepend "assets" to whatever is passed in to it. Is there a disadvantage to just using the text "/assets/data/table.txt"
- How would I pass a javascript variable into @routes.Assets.at
Thanks in advanced!