-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,168
  • 13
  • 59
  • 101

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
  • 25,301
  • 12
  • 66
  • 87
Evan
  • 5,797
  • 7
  • 32
  • 59
1
$("title").first().text("New title");
Falcon
  • 1,486
  • 2
  • 15
  • 28