0

I am using include method to include the menu page on every pages, code below:

<!--#include virtual="include/menu/Menu.html"

This Menu.html page has a static title <Title>ABC</Title>. Note that the Title for current viewing page does not show its Title, but only show the Title for the included Menu.html page, which is "ABC".

Is there a way to change the <Title><Title> for the menu page (not the Title on the current viewing page) by using JavaScript, jQuery, or any trick you can think of?

halfer
  • 18,701
  • 13
  • 79
  • 158
Milacay
  • 1,277
  • 5
  • 30
  • 49

2 Answers2

2

You can also just use plain javascript:

document.title = "The new title";
1andsock
  • 1,537
  • 9
  • 15
0

You can do this:

$('title').text('New title');

There is another jQuery method called html() but that's only suitable when adding content that must be understood as tags. Since titles cannot contain HTML, text() is appropriate.

halfer
  • 18,701
  • 13
  • 79
  • 158