Documentation about difference between javacript src and javascript library in grails
Posted
by damian
on Stack Overflow
See other posts from Stack Overflow
or by damian
Published on 2010-06-03T16:22:11Z
Indexed on
2010/06/03
16:24 UTC
Read the original article
Hit count: 253
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?
© Stack Overflow or respective owner