0 Replies Latest reply on Mar 27, 2012 12:49 PM by Elijah Baley

    Richfaces 4 jQuery load sequence, jQuery(document)

    Elijah Baley Newbie

      I have a javescript that needs jquery pretty early on (it attaches an event handler to the document):

      myScript.js:

      jQuery(document).bind(...)
      

       

      The page itself loads this js file simply this way:

       

      <h:head>
        <rich:jQuery/>
        <script type="text/javascript" src="myScript.js"/>
      </h:head>
      

       

      When myScript executes in the browser, I see that RichFaces, jQuery, $ are not defined. After it errors out and page is fully loaded, then I do see all the resources load (but too late for myScript.js).

       

      What am I doing wrong?