开发者

How do I make a jQuery script work on Grails?

开发者 https://www.devze.com 2023-01-18 22:16 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消