-1

Possible Duplicate:
jQuery: how to change title of document during .ready()?

How to change the name of the page with jquery and ajax?

I would like to use php script and call the load function. The function returns the title to me. How do I set the page title?

Community
  • 1
  • 1
Jenan
  • 3,408
  • 13
  • 62
  • 105

3 Answers3

2

JQuery is probably overkill for setting a title when you can just do

document.title = 'foo';

but if you really want to use JQuery you can do

$("title").text("foo");

It's probably a lot slower though, although if you're only doing it once I wouldn't worry about that.

bhuber
  • 366
  • 3
  • 6
1
document.title("Whatever Title");

also i wonder if this will work:

$("title").html("Whatever Title");
JMax
  • 26,109
  • 12
  • 69
  • 88
Evan
  • 5,975
  • 8
  • 34
  • 63
1
$("title").first().text("New title");
Falcon
  • 1,461
  • 3
  • 15
  • 29