Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Include jQuery js.

  1. #1

    Default Include jQuery js.

    Hi,

    I'm looking into the jQuery plugin: http://www.grails.org/plugin/jquery
    and as described in docs I have added:
    Code:
    <g:javascript library="jquery" plugin="jquery"/>
    to the layout.

    but this tag is rendered as:
    Code:
    <script type="text/javascript" src="/timeorg/plugins/jquery-1.4.4/js/jquery/jquery-1.4.3.js"></script>
    instead of something like:
    Code:
    <script type="text/javascript" src="/timeorg/js/jquery/jquery-1.4.3.min.js"></script>
    What am I missing?

  2. #2

    Default

    OK I've got it to the point that the tag renders as:
    Code:
    <script type="text/javascript" src="/timeorg/plugins/jquery-1.4.4/js/jquery/jquery-1.4.4.js"></script>
    But where is this file is coming from?
    I don't have jQuery-1.4.4 in my project, just 1.4.3

    and why it's not pulling the minified version?

  3. #3
    Join Date
    Jul 2007
    Posts
    123

    Default

    There's a bug in the plugin; I described a workaround on the User mailing list here: http://grails.1312388.n4.nabble.com/...td3095815.html

    The User mailing list has a lot more subscribers than this forum, so you might want to ask questions there. The Dev list is for discussion of Grails development though, so usage questions aren't relevant there.

  4. #4

    Default

    Thanks, but when I'm trying to install jQuery by running this:
    Code:
    grails installJQuery
    it still installs 1.4.3 ???

  5. #5
    Join Date
    Jul 2007
    Posts
    123

    Default

    Probably, I haven't used that script. The plugin comes with the jQuery javascript file, so you can use that directly as shown in the docs, e.g.

    Code:
    <g:javascript library='jquery' plugin='jquery' />

  6. #6

    Default

    Where is this file located?

  7. #7
    Join Date
    Jul 2007
    Posts
    123

    Default

    $HOME/.grails/<grailsversion>/projects/<projectname>/plugins/jquery-1.4.4/web-app/js/jquery

    The <g:javascript> tag figures that out though. You just need to make the Config.groovy change I posted.

  8. #8

    Default

    I did, but my problem now is where is the file coming from. Because I don't have 1.4.4 in my project path.

    Who can I forse to use my file in 'js/jquery' folder?

  9. #9
    Join Date
    Jul 2007
    Posts
    123

    Default

    It's not in your project path, it's where I said it is - in the plugin source under the .grails folder. The primary purpose of the plugin is to reduce duplication.

  10. #10

    Default

    OK, another question then:
    What happens when the application is deployed? Will the app create the same structure on the server on deploy?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •