This content has been marked as final.
Show 2 replies
-
1. Re: JavaScript file order
ilya40umov Dec 24, 2012 1:54 PM (in response to spinacz)Are you placing your h:outputScript into h:head or h:body tag?(If you do put them into h:head, try h:body instead)
-
2. Re: JavaScript file order
spinacz Jan 11, 2013 6:30 AM (in response to ilya40umov)Hi, sory for a break, i had other tasks to do.
Yes, i tried use "body" instead head. It didn't help.
Now i have this entries in my head_section.xhtml:
<!-- JSF --> <h:outputScript name="jsf.js" library="javax.faces" target="head"/> <!-- RichFaces --> <h:outputScript name="jquery.js" target="head"/> <h:outputScript name="richfaces.js" target="head"/> <h:outputScript name="richfaces-queue.js" target="head"/> <h:outputScript name="richfaces-base-component.js" target="head"/> <h:outputScript name="status.js" library="org.richfaces" target="head"/> <!-- FS3 --> <h:outputScript library="javascript" name="jquery-min.js" target="head" rendered="false"/> <h:outputScript library="javascript" name="fancybox/jquery.fancybox-1.3.4.pack.js" target="head"/> <h:outputScript library="javascript" name="jquery.newsticker.pack.js" target="head"/> <h:outputScript library="javascript" name="ui.tabs.pack.js" target="head"/> <h:outputScript library="javascript" name="jquery.cookie.js" target="head"/> <h:outputScript library="javascript" name="jquery.simplemodal.js" target="head"/> <h:outputScript library="javascript" name="MyScript1.js" target="head"/> <h:outputScript library="javascript" name="MyScritp2.js" target="head"/> <h:outputScript library="javascript" name="MyScript3.js" target="head"/><!--tylko SG--> <h:outputScript library="javascript" name="scripts.min.js" target="head"/>
In rendered html before </head>, there are ale files in the samse order like above, but javascrip function doesn't work. In the console frome developer tools i saw
Uncaught ReferenceError: mainFunction is not defined"
but file with function MyScript1.js is loaded after javascript from JSF and RF4.
probably i miss something, but i have no idea what should i check