How do I make a jQuery script work on Grails?
How do I make a jQuery function work with Grails??
I installed the jQuery plugin and added grails.views.javascript.library="jquery" at the end of con开发者_StackOverflow中文版f/Config.groovy
And when I trigger the function I get an error saying
Object Expected
I checked the code and is fine, you can check it out here: http://www.jsfiddle.net/dCy6f/
When I write the number into the textfield I get the error.
Any ideas of what I might be doing wrong?? Or maybe I'm missing something??
Thanks in advance!!
Make sure you have
<g:javascript library="jquery" plugin="jquery" />
in the <head>
section of your view. Put this in grails-app/views/layouts/main.gsp
if you want it in all your views.
精彩评论