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

  • Home
  • SEARCH
  • 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 6543047
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:17:58+00:00 2026-05-25T11:17:58+00:00

I had the following in the <head> of a GSP <script type=text/javascript> $(button.remove-item).click(function() {

  • 0

I had the following in the <head> of a GSP

<script type="text/javascript>
    $("button.remove-item").click(function() {
        $.ajax({
            url: "${createLink(action: 'remove', controller: 'cart')}",
            type: 'POST'
        });
    });
</script>

Notice that I’m using the Grails createLink tag to construct the URL that the AJAX request will post to. When I moved this code into checkout.js and replaced the block of code above with:

<script type="text/javascript" src="${resource(dir: 'js', file: 'checkout.js')}"></script>

the createLink tag is no longer evaluated by Grails. So it seems that Grails tags within <script> blocks are evaluated, but tags within .js files included by GSPs are not – is there a way to change this?

  • 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-25T11:17:58+00:00Added an answer on May 25, 2026 at 11:17 am

    Check out the GSParse plugin to have css and js parsed as a gsp file:

    http://nerderg.com/GSParse

    http://grails.org/plugin/gsp-arse

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

Sidebar

Related Questions

I've got the following in my <head> section: <script type=text/javascript> $(function(){ $(h5).live(click, function(){ alert($(this).tmplItem());
I have the following code: <html> <head> <title>D</title> <script type=text/javascript src=jQuery.js> <script type=text/javascript> $(window).unload(
I developed an HTML page that uses jQuery and Ajax. I had the following
I included a script into my document's head that contains the following jquery code:
Following is the script that makes a jump menu.Using javascript i have set the
I was following a tutorial today that had me scratching my head for an
I had the following line snippet of code that searches for a propery of
I had the following idea: Say we have a webapp written using django which
I had the following problem today, and I was wondering if there is a
I had the following HTML page rendering to use the Google Maps API. This

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.