/ Published in: JavaScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
var foo = "bar"; if ( typeof( window[ 'foo' ] ) != "undefined" ) { document.write("foo is defined") } else { document.write("foo is undefined") }
URL: http://www.rgagnon.com/jsdetails/js-0112.html