Archive

Archive for the ‘Javascript’ Category

Strange anomolies with javascript in grails

September 6, 2011 Leave a comment

blimey more weird stuff

java script includes

tried to include a .js file into my page to use and ran into weird stuff on mozilla

if i write a line like

<br />&lt;script type="text/javascript" src="${createLinkTo (dir:'js/', file:'jquery.util-1.0.js') }" /&gt;<br /><br />

Then no errors are reported but the file doesnt load and contents dont get loaded correctly.

if i modify the above to

<br />&lt;script type="text/javascript" src="${createLinkTo (dir:'js/', file:'jquery.util-1.0.js') }" &gt;&lt;/script&gt;<br /><br />

Everything gets loaded fine

also if you use grails tag it works

<br />&lt;g:javascript src="jquery.util-1.0.js" /&gt;<br />

but I looked at the source generated and grails tag builds the seperate for you

Categories: Grails, Javascript
%d bloggers like this: