rklockner Posted December 20, 2011 Share Posted December 20, 2011 I have a page that contains 15 tabs. When each tab is pressed, it calls a function that uses .load() to load that tab. In my initial testing, all seems to go smoothly (loading in less than a second). However, once you click about 10 tabs, the pages start to load slower, and by click 13, it takes more than 30 seconds to load. If you refresh the page this process starts over and the outcome is the same (by click 12-13 it is unusable). Below is the code. FYI the reload_timer was an attempt to reload the page if the query was taking more than 10 seconds... It didn't work. I left it in for feedback in case I don't find a suitable solution to the actual issue. <a onclick="getNewPage('page_name', this, 'co_applicant');" >Co-Applicant</a> <div id="result_container"></div <script> function getNewPage(newpage, el, tab){ var reload_timer = setTimeout('window.location.reload()', 10000); $('#lead_content').html('<p>Data Loading: <img src="images/ajax-loader-2.gif" width="220" height="19" /></p>'); $('#result_container').load(newpage+".php?leadid=<?=$leadid?>new_tab="+tab, function(){ clearTimeout(reload_timer); }); $('a').attr('class', ''); el.className = 'selected'; } </script> Quote Link to comment https://forums.phpfreaks.com/topic/253561-jquery-load-issue/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.