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>

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?

Answers


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.


Need Your Help

how the get estimated output in timer

c# timer

I am working with two timers:

ObjectInputStream.readObject does not retrieve object

java android arraylist objectinputstream

I would not surprised if the reason ObjectInputStream.objectRead does not seem to work for me is because I missed something obvious.