The Window and Document objects are core Javascript features and can be expected in all circumstances, but which methods are supported?
var fbtext = “Feedback text”; var fbwin; if((window.focus)&& (document.open)&& (document.write)&& (document.close)){ // All necessary methods exist fbwin = window.open(”, ‘Feedback’, ‘width=410, height=200, menubar=no, status=no, toolbar=no, resizable=no’); fbwin.document.open(); fbwin.document.write(fbtext); fbwin.document.close(); fbwin.focus(); } else{ // Some critical methods don’t exist, // use a standard alert instead alert(fbtext); }