Alicia Posted September 10, 2012 Share Posted September 10, 2012 Hi, May I know is there any way I can prevent the content in other inactive tab of a spry tabbed from loading? Currently all my tabs content needs to connect to the database to fetch the data. Most of the users don't really click on the other tabs but I found it is very resource consuming since once the spry tabbed is loaded, all tabs will start to connect to the db and fetch the records even the user doesn't click on the tab. Or is there any other way I can use the get the same thing? I need feature like tab but it will only load the active tab content. Please advise. Thanks in advance. ALicia Quote Link to comment https://forums.phpfreaks.com/topic/268203-stop-loading-in-inactive-tab/ Share on other sites More sharing options...
Jessica Posted September 10, 2012 Share Posted September 10, 2012 What is a spry? What code are you using to do the tabs? There are plenty of plugins for libraries like jQuery that do exactly what you're describing. Quote Link to comment https://forums.phpfreaks.com/topic/268203-stop-loading-in-inactive-tab/#findComment-1376677 Share on other sites More sharing options...
Alicia Posted September 10, 2012 Author Share Posted September 10, 2012 spry tab is the tab that generated from the dreamweaver. I have 8 tabs in the page and each of the tab will show different content after getting the content from the database. My problem now is everytime user loads the page, it will run all queries in all tab instead of the first active page. Is there anyway I can stop other queries in other inactive tab from sending to the server unless they click on the tab and it turns to an active one? thanks Quote Link to comment https://forums.phpfreaks.com/topic/268203-stop-loading-in-inactive-tab/#findComment-1376728 Share on other sites More sharing options...
Jessica Posted September 10, 2012 Share Posted September 10, 2012 Yes, there is. Either using your code, or a different library. Please, abandon dreamweaver. Quote Link to comment https://forums.phpfreaks.com/topic/268203-stop-loading-in-inactive-tab/#findComment-1376737 Share on other sites More sharing options...
ignace Posted September 10, 2012 Share Posted September 10, 2012 https://github.com/ai/visibility.js#readme More interesting libraries can be found at: http://cdnjs.com/ Quote Link to comment https://forums.phpfreaks.com/topic/268203-stop-loading-in-inactive-tab/#findComment-1376751 Share on other sites More sharing options...
Christian F. Posted September 11, 2012 Share Posted September 11, 2012 You don't need to use AJAX (JavaScript) to do this at all, but you need to edit the server-side code. For that, you need to know basic PHP. As Jesi said: Please, please abandon DW (and any other WYSIWYG-editors). Quote Link to comment https://forums.phpfreaks.com/topic/268203-stop-loading-in-inactive-tab/#findComment-1376918 Share on other sites More sharing options...
Jessica Posted September 11, 2012 Share Posted September 11, 2012 If OP doesn't want the tab to be loaded until the user clicks it, they do need AJAX. Quote Link to comment https://forums.phpfreaks.com/topic/268203-stop-loading-in-inactive-tab/#findComment-1377011 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.