views:

581

answers:

3

I have coded myself into a corner. Does anyone know the answer? Thanks!

+2  A: 

Try:

$(document).ready(function() {
    this.title = 'foo'
})
Crescent Fresh
+3  A: 
document.title = 'new value';

Is this not working for you?

ceejayoz
Strangely no. I can read the value of document.title, but I cannot seem to change the display. I have tried setting it in the head of the document as well as in the body.
subbit
@subbit, Are you sure your browser isn't preventing you from changing the title? Check your browser's options.
strager
A: 

This will work also:

$('title').text("Boo");
Vincent Ramdhanie
`.text` is preferable.
strager
Not sure why I couldn't get the document.title or this.title to take, but Vincent's method did the trick. I should've been more specific in what I was doing, I suppose, in my question. I am grabbing the contents of a div near the end of the html body and writing it out to the page title. If I figure out what the problem was I'll post it up here.
subbit
I Agree with @strager. I will edit the answer to suit.
Vincent Ramdhanie