I am trying to figure out an error with JQuery when I tried to create tabs for my ASP.Net application(I am a novice in JQuery)..
Below is the code I am trying, when I tried debugging using Chorme Dev.tool found error"no such method 'add' for tabs widget instance" and I found out "tabsDiv.tabs("add", '#main', pages[i][0]);" this does not work anymore as the "add" method is deprecated from the newer version of JQuery. Could anyone help me to find way to overcome this??
<script type="text/javascript">
$(document).ready(function () {
var pages = [
['Events', "/Listings.aspx", "/AddEvent.aspx", "UpdateOrDelete.aspx"],
['Performance', "/Performance.aspx"]
];
var myPage = '<%=Request.Path %>';
var tabsDiv = $('#masterTabsDiv');
tabsDiv.tabs({
select: function (event, ui) {
document.location = pages[ui.index][1];
return false;
}
});
var indexToSelect = 0;
for (var i = 0; i < pages.length; i++) {
for (j = 0; j < pages[i].length; j++) {
if (pages[i][j] == myPage) {
indexToSelect = i;
window.alert("set block 2");
break;
}
}
tabsDiv.tabs("add", '#main', pages[i][0]);
}
window.alert("set block 4");
tabsDiv.find('li').removeClass('ui-tabs-selected ui-state-active');
tabsDiv.find('li').eq(indexToSelect).addClass('ui-tabs-selected ui-state-active');
});
</script>
Thanks, Raam