Is it possible to access
grails.app.context
from within a javascript library? –That is, not javascript inserted in a GSP file.
I have som javascripts that are context dependent, why I need to be able to access this from javascript.
I include the javascript in my gsp-files with:
<r:require modules="myModule" />
You can pass it to Javascript as global JS variable, put this inside
<head>tag:and use it anywhere from plain javascript, like: