.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
- <script language="JavaScript">
- function content(n){
- $('#menu-content').html('<p><img src="images/ajax-loader.gif" width="16" height="16" /></p>');
- setTimeout(function(){go(n);}, 500);
- }
-
- function go(i){
- if (i==1) {
- $('#menu-content').load('test.html');
- }
- else
- if (i==2) {
- $('#menu-content').load('test2.html');
- }
- }
- </script>
- <body>
- <a class="companybtn" href="javascript:content(1)"><span class="hover"></span></a>
- <div id="menu-content">
- </div>
- </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.