How to prevent adding a 'tabs' all over again?
Hello. I'm new to jquery UI. How to prevent adding a 'tabs' all over again? Thanks!
eg:
var $tabs = $('#tabs').tabs({
tabTemplate: '<li><a href="#{href}">#{label}</a> <span class="ui-icon ui-icon-close">Remove Tab</span></li>',
add: function(event, ui) {
$tabs.tabs('select', '#' + ui.panel.id);
},
ajaxOptions: {
error: function(xhr, status, index, anchor) {
$(anchor.hash).html("Couldn't load this tab. We'll try to fix this as soon as possible. If this wouldn't be a demo.");
}
}
});
// actual addTab function: adds new tab using the title input from the form above
function addTab(ClassUrl) {
var tab_title = $tab_title_input.val() || 'Tab '+tab_counter;
$tabs.tabs('add', ClassUrl, tab_title);
tab_counter++;
}