.load() working on all browsers except chrome.

.load() working on all browsers except chrome.

I am new to jQuery and would be glad if someone help me out with this.

I want to insert content from external html files based on links clicked. I am using the following code

  1. <script language="JavaScript">
  2. function content(n){
  3.                 $('#menu-content').html('<p><img src="images/ajax-loader.gif" width="16" height="16" /></p>');
  4.                 setTimeout(function(){go(n);}, 500);
  5.             }
  6.                 
  7.             function go(i){
  8.                 if (i==1) {
  9.                     $('#menu-content').load('test.html');
  10.                 }
  11.                 else
  12.                     if (i==2) {
  13.                         $('#menu-content').load('test2.html');
  14.                     }
  15.             }
  16. </script>
  17. <body>
  18. <a class="companybtn" href="javascript:content(1)"><span class="hover"></span></a>
  19. <div id="menu-content">
  20. </div>
  21. </body>
It works great with all the browsers except for chrome. In Chrome, the ajax-loader image displays. Then it disappears which means that the setTimeOut function has been implemented. But then it displays nothing. So I don't know whether the browser has even entered the 'go' function or not.

Would be glad if someone clear this out. Thank you.