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
  • 19,471
  • 17
  • 87
  • 173
Milacay
  • 1,377
  • 6
  • 31
  • 53

2 Answers2

2

You can also just use plain javascript:

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

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
  • 19,471
  • 17
  • 87
  • 173