Application address: http://chengyong.iteye.com/blog/1846455
define(function(require, exports, module) { if (!window.cms) window.cms = {}; cms = { //Add new tab page addTab : function(data) { var content = '<iframe scrolling="auto" frameborder="0" src="' + data.url + '" style="width:100%;height:100%;"></iframe>'; if ($('#homePageTabs').tabs('exists', data.title)) { // select the current tab $('#homePageTabs').tabs('select', data.title); // Reload existing tab content var currTab = $('#homePageTabs').tabs('getTab', data.title); $('#homePageTabs').tabs('update', {tab: currTab, options: {content: content, closable: true}}); } else { $('#homePageTabs').tabs('add', { title : data.title, content : content, closable : true }); } }, //Close the specified Tab closeTab : function(title) { if ($('#homePageTabs').tabs('exists', title)) { $('#homePageTabs').tabs('close', title); } }, //Refresh the contents of the specified Tab refreshTab: function(title){ if ($('#homePageTabs').tabs('exists', title)){ var currTab = $('#homePageTabs').tabs('getTab', title), iframe = $(currTab.panel('options').content), content = '<iframe scrolling="auto" frameborder="0" src="' + iframe.attr('src') + '" style="width:100%;height:100%;"></iframe>'; $('#homePageTabs').tabs('update', {tab: currTab, options: {content: content, closable: true}}); } } } }); cms.addTab({ id : 'homePageTabs', title : 'Update Homepage', url : '/homePage/intoUpdate' });