开发者

Documentation about difference between javascript src and javascript library in grails

I know that if you write in a view:

<g:javascript src="myscript.js" />
<g:javascript src="myscript.js" />
<g:javascript src="myscript.js" />

<!-- other try -->
<g:javascript library="myscript" />
<g:javascript library="myscript" />
<g:javascript library="myscript" />

It will out output:

<script type="text/javascript" src="/vip/js/myscript.js"></script>
<script type="text/javascript" src="/vip/js/myscript.js"></script>
<script type="text/javascript" src="/vip/js/myscript.js"></script>

<!-- other try -->
<script type="text/javascript" src="/vip/js/myscript.js"></script>

Conclut开发者_如何学Pythonion: with library it will try to include only once.

I have been try to find documentation about it without success.

Do you have any pointer?


Yes the Source Code

Check out the Documentation (http://grails.org/doc/latest/ref/Tags/javascript.html) then click Show Source you will see the code is only going to output the first time

if(!request[INCLUDED_LIBRARIES].contains(attrs.library)) {

Hope this helps.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜