Home  >  Article  >  Web Front-end  >  Code based on jquery to modify the current TAB display title_jquery

Code based on jquery to modify the current TAB display title_jquery

WBOY
WBOYOriginal
2016-05-16 18:14:031163browse

A friend proposed the following application scenario:
After clicking a link in the current tab, new content is displayed in the current tab, but the title content is still the title of the previous page and needs to be changed to a new title. Solution For example:
First add the following code to outlook.js:

Copy the code The code is as follows:

function changeCurrentTabTitle(oldtitle,newtitle,url){
var currTab = $('#tabs').tabs('getTab',oldtitle);
// or var currTab = $('#tabs ').tabs('getSelected'); //This can also be done
$('#tabs').tabs('update',{tab:currTab,options:{title:newtitle,content:createFrame(url) }});
}


This method receives two parameters: oldtitle is obviously the title of the current page, and newtitle is the title to be displayed on the new page
When clicked This method is called when the link jumps. Code such as:
Script Home
This solves the problem at the beginning .
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn