调试运行
<html> <head> <title>判断一个对象是否存在</title> </head> <body> <script language="javascript"> <!-- function person(){} Jim = new person(); if(window.Jim){ document.write("Jim对象存在"); }else{ document.write("Jim对象不存在"); } //--> </script> </body> </html>