Can not add second tab with iframe
I need add tabs to my page dynamically (use iframe as container)
var $tabs = $("#main").tabs({
cache: true,
add: function(event, ui) {
$tabs.tabs('select', '#' + ui.panel.id);
}
, select: function(event, ui) {
var url = $.data(ui.tab, 'load.tabs');
if (url) {
$('#' + ui.panel.id).attr("src", url);
}
return true;
}
, panelTemplate: '<iframe id="a-tab-panel" src=""></iframe>'
});
$("#li1").click(function() {
$tabs.tabs('add', 'a.aspx', 'tab1');
//page with jquery.js included
});
$("#li2").click(function() {
$tabs.tabs('add', 'b.aspx', 'tab2')
//page without jquery.js
});
if you use #li2 to add tab, it work's fine, if you use #li1, only one tab can be add, the others can not load content.
I have debug the code ,it seem's $.data(ui.tab, 'load.tabs') can not get a valid value.