Jquery-based code for modifying the title of the current tab

Source: Internet
Author: User

A friend proposed the following application scenarios:
After clicking the link on the current tab, the new content is displayed on the current tab. However, the title must be changed to the new title on the previous page. The solution is as follows:
Add the following to outlook. JS:Code:

Copy codeThe 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
$ ('# 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.
This method is called when you click link jump. The Code is as follows:
<A href = '# 'onclick = 'self. Parent. changecurrenttabtitle ("Current title", "new name", "http://www.jb51.net);'> Home of feet </a>
In this way, the starting part of the problem is implemented.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.