I have this javascript in a classic asp page…
I need to find out if x.name is undefined or has a value:
x=document.getElementsByTagName("meta")[i];
if (String(x.name) != "undefined" && String(x.name) != ""){
document.write(""+x.name +": "+x.content+"<br><br>");
}
I am not sure why it is throwing an error:
document.write(""+x.name +": "+x.content+"<br><br>");
if x.name or x.content is false?
Thanks
To check for undefined:
Now, I don’t know what you’re trying to do with that
document.write()call, so that might cause problems too, but the above will make sure you only do it when “x” exists and has a non-empty “name” attribute.