document.title *is* the way to do that. You have a case where it doesn't
work? Now I'm curious - I'd sure like to see a test page if you have one.

-Mike

> From: DaveT
> 
> I'm working with a fairly complex page that is heavily 
> controlled by some Javascript that's external to my code. I'm 
> trying to read the document's title text, first trying to use 
> straight Javascript, ie:
> 
>     var txt = document.title;
> 
> And while this works on a simple page (where the title is set 
> by the document's head > title tag), it doesn't work on the 
> more complex Javascript-controlled page. I suspect the 
> Javascript is setting the browser's title bar property rather 
> than using the title tag.
> 
> So I thought I'd try using jQuery to get this, using code like this:
> 
>     var jQtxt = $('head > title:first').text();
> 
> It's trying to do the same thing as the first example, but 
> oddly doesn't seem to work on IE even with a simple page.
> 
> So my question boils down to:
> 
> What's the simplest rock-solid way to get the browser's 
> titlebar text that works in both IE and Firefox?
> 
> Appreciate any help!
> 
> -dave
> 

Reply via email to