I am playing this Jqueryui Tab Manipulation but I could not modify it the way I want it to work. I have menu like
<li onclick="createTab('Title','home.php')">Home</li>
<li onclick="createTab('Title','edit.php')">Edit</li>
<li onclick="createTab('Title','view.php')">View</li>
<div id="tabs">
<div id="#tabs-1">
<ul>
<li><a href="#tabs-1">Tab Title here</a>
<span class="ui-icon ui-icon-close" role="presentation">Remove Tab</span>
</li>
</ul>
</div>
<div id="tabs-1">tab content will be here</div>
</div>
The Jqueryui function I am working so far:
function creatTab(Title, url, e=null) {
e.preventDefault();
var label = Title.val() || "Tab " + tabCounter,
id = "tabs-" + tabCounter,
li = $( tabTemplate.replace( /#\{href\}/g, "#" + id ).replace( /#\{label\}/g, label ) ),
var tabContentHtml = load(url) || "Tab " + tabCounter + " content.";
tabs.find( ".ui-tabs-nav" ).append( li );
tabs.append( "<div id='" + id + "'><p>" + tabContentHtml + "</p></div>" );
tabs.tabs( "refresh" );
tabCounter++;
}
and I want to dynamically create tab and load edit.php in the newly created tab content area when a user clicks on Edit menu and so on. In the tab manipulation demo, instead of loading content, it uses dialogue. I am looking for solution in Google for quite a long hours but could not find it except some library like jquery easyui offers simple solution. This does not help as I have already decided to use jqueryui for my project. Please help me.