在哪里放置,以及如何在Grails应用程序中访问jQuery插件?(Where to place, and how to access a jQuery plugin in a Grails appl

编程入门 行业动态 更新时间:2024-10-13 10:26:38
在哪里放置,以及如何在Grails应用程序中访问jQuery插件?(Where to place, and how to access a jQuery plugin in a Grails application?)

我的问题与这个问题类似。 我想知道我会在我的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

本文发布于:2023-08-01 23:29:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1365845.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:应用程序   插件   如何在   plugin   Grails

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!