Yeah, that was the direction I was going in.
- $('#tabs').tabs({
select: function(e, ui) {
self.loadSelectedTab(ui);
}
});
And in loadSelectedTab I would look at which tab was selected and then execute the appropriate JavaScript code?
- loadSelectedTab: function(ui) {
switch($(ui.tab).attr("href")) {
case "#users-tab":
this.loadUsersTab(ui.panel);
break;
case "#errors-tab":
this.loadErrorsTab(ui.panel);
break;
case "#accounts-tab":
this.loadAccountsTab(ui.panel);
break;
default:
console.log('No such tab...');
}
}
I was hoping to be able to specify the JavaScript code I want executed within the HTML that defines that tabs. And not have to use the "switch" statement.
Either as an attribute of the anchor tag or somewhere in the div tab that corresponds to the panel for the tab.
Thanks,
Mike