jquery hover not working properly other than IE6

jquery hover not working properly other than IE6

Hi All,

I developed a menu bar and using jquery for mouse hover functionality. I found that the document.ready is being fired with out loading the complete document.

  1.     $(document).ready(function(){
  2.     alert(" Doc Loaded"); //It prints
  3.     alert($(".mainLinks").length); // Most of the times it prints 0, some times it prints the exact count.

mainLinks is the class name of <a> which is dynamically generated from XML. This works perfectly in only IE and not in other browsers esp when we hit F5 key.

script files included in this order.

  

  1.      <script type="text/javascript" src="jquery.js"></script>
  2.          <script type="text/javascript" src="navBar.js"></script> // generates menu
  3.       <script type="text/javascript" src="now.js"></script> //hover functionality

I call showNavBar("","") in the middle of jsp.

If I include generated menu content in jsp, it works fine coz it is getting the count every time.

Please let know how should I make sure that the document is completely loaded./ In other way why is it not loaded completely.

Thanks | Kranthi