thanks this worked well. I guess the key the if statement is testing for truth
of a statement that anything that makes it false counts as false even if its
non existence.
o = document.getElementsByTagName('title')[0]) &&
nice code. thanks
On 6/17/07, RobG <[EMAIL PROTECTED]> wrote:
On Jun
On Jun 17, 4:06 pm, RobG <[EMAIL PROTECTED]> wrote:
[...]
> alert('The document title is: ' + o.title);
Of course that should be o.text
--
Rob
On Jun 17, 2:52 pm, "Scottus " <[EMAIL PROTECTED]> wrote:
> I am using
>
> var title = document.getElementsByTagName('title').item(0).innerHTML;
>
> to get the content of a pages title tag.
>
> But if the page has no title tag I get
>
> "Error: document.getElementsByTagName("title").item(0) has n
Why wouldn't you use something like this:
$("title").val();
Chris
Scottus wrote:
I am using
var title = document.getElementsByTagName('title').item(0).innerHTML;
to get the content of a pages title tag.
But if the page has no title tag I get
"Error: document.getElementsByTagName("title")
4 matches
Mail list logo