我的问题与这个问题类似。 我想知道我会在我的Grails应用程序中放置一个jQuery插件 ,特别是jQuery数字插件 。
一旦我将该插件放在适当的位置,我该如何从我的视图中访问它? 我问这个是因为当我在Grails(版本1.3.7)中使用jQuery时,我使用我在这里找到的插件,并在安装该插件后访问jQuery,我在<head>标签中使用以下代码:
<g:javascript library="jquery" plugin="jquery"/>所以说, 我的头标记需要什么代码,所以我可以访问数字插件?
My question is similar to this question. I am wondering where I would place a jQuery plugin in my Grails application, specifically the jQuery numeric plugin.
Once I have that plugin in the proper location, how do I access it from my view? I ask this because when I use jQuery in Grails (version 1.3.7) I use the plugin I found here, and to access jQuery after installation of that plugin I use the following code in my <head> tag:
<g:javascript library="jquery" plugin="jquery"/>So with that said, what code do I need in my head tag so I can access the numeric plugin?
最满意答案
按着这些次序:
将.js文件添加到web-app/js/ ,这将使它们在<context-root>/js/下的已部署应用程序中可用将此标记添加到主页面中的标题中,如果不需要,则将其添加到GSP中。
<g:javascript src="plugin.jquery.js"/>
有关g:javascript标记的更多信息,请参见此处。
Follow these steps:
Add your .js file(s) to web-app/js/, which will make them available in the deployed application under <context-root>/js/Add this tag to your header, either in the main layout, or a GSP if not needed everywhere.
<g:javascript src="plugin.jquery.js"/>
See here for more information on the g:javascript tag.
更多推荐
jQuery,plugin,Grails,电脑培训,计算机培训,IT培训"/> <meta name="descript
发布评论