Skip to content

Instantly share code, notes, and snippets.

@earthling-shruti
Last active December 16, 2015 17:40
Show Gist options
  • Save earthling-shruti/5472091 to your computer and use it in GitHub Desktop.
Save earthling-shruti/5472091 to your computer and use it in GitHub Desktop.
config/ApplicationResources.groovy:
modules = {
application {
resource url:'js/application.js'
}
xyz {
resource url:'js/xyz.js'
}
}
views/layout/main.gsp:
...
<g:javascript library="xyz"/>
<g:layoutHead/>
<r:layoutResources />
</head>
views/something/edit.gsp:
...
<g:javascript library="xyz"/>
<r:layoutResources />
<script>
$(document).ready(function() {
//some function call from xyz.js
});
</script>
</head>
Error:
"Error processing GroovyPageView: Error executing tag <g:javascript>: Cannot add resource with disposition [defer] to this request - that disposition has already been rendered."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment