[jQuery] Dealing with Non existent nodes
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 no properties"
and the script craps out.
any ideas about how to deal with this ?