If I have 4 tabs where the first 2 are loaded using ajax and the last 2 are static, how do I preload ajax 2 tabs by default?
At the moment, only the first tab is automatically loaded, the second - when pressed. I want both of them to be loaded, so when I click the second, the content is already loaded. I tried to trigger the load event on the second tab as follows:
$(document).ready(function () {
$("#main-tabs").tabs({
cache: true
});
$("#main-tabs").tabs("load", 1);
});
And this loads the second tab, but for some strange reason, the first does not load at all; even when I click on another tab and click on the first, it will not load.
Then I tried something like this:
$(document).ready(function () {
$("#main-tabs").tabs({
cache: true
});
$("#main-tabs").tabs("load", 0);
$("#main-tabs").tabs("load", 1);
});
The same result, the second tab is loaded, the first is not.
How do all of them (ajax) load automatically?