views:

38

answers:

1

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>

Conclution: 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?

A: 

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.

Scott Warren