Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6535889
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:25:35+00:00 2026-05-25T10:25:35+00:00

I have a layout main.gsp including scripts before the /body tag: <g:pageProperty name=page.scripts />

  • 0

I have a layout main.gsp including scripts before the /body tag:

<g:pageProperty name="page.scripts" />

Index.gsp is a page which has main.gsp has a template, and uses <content tag="scripts"> to include some javascript, so that all scripts stay nicely together before the /body tag

I have my template with I include in my page (index.gsp) with the following instruction:

<g:render template="postbox" />

for this template to reusable and independent, it needs its own script. How can I include it and have it placed right before the /body tag? If I use <content tag="scripts"> it overwrites the scripts I declared in index.gsp

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T10:25:35+00:00Added an answer on May 25, 2026 at 10:25 am

    In my opinion you should use the Grails Resources Plugin.
    This plugin will organize your javascript code, javascript dependencies, and you can modularize your javascript files so that some pages (or templates) depend on specific javascript files.

    You will be able to create a postbox.js file , and declare in your _postbox.gsp template that it depends on postbox.js script.

    The plugin will even go further and decide if it is best to put the script before the body tag, or at the end of your html file right before /body tag. It implements best practices for JS and CSS manipulation. Great stuff.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The background is : I have layout page main.gsp I need to conditionally show
I have a res/layout/main.xml including these elements and others: <some.package.MyCustomView android:id=@+id/foo (some other params)
I have a main layout in which I'd like to sequentially display / hide
Right I have a main layout defined, that has a frame, a table in
I have the following situation: in the main file I do setContentView(R.layout.main); which looks
I have a reasonably complex layout problem: I would like to have a main
Suppose I have the following directory layout in a Maven project: src/ |-- main
I have a layout which uses min-width and works great. So I came to
I have a layout that is working, but it has one very annoying problem..
I have a layout in which I am displaying a webview . I want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.