Is there a way to define different javascript files for various view pages in the play framework?
One approach is:
@main(title, """
@*JS CODE*@"""
{
//Template Codes
}
Then in the main template, it can be used like this:
@(title,stringJS){
<script>
@Html(stringJS)
</script>
}
However, what if the JS code needs to be used on only specific pages and not all? It wouldn't make sense to copy the JS code into every related view page. In my situation, all javascripts are loaded in the footer, which is a separate template.
How can we address this issue??
Any assistance would be greatly appreciated. Thank you!