if (window.navigator.appName.toLowerCase().indexOf("netscape") > -1) 
{
   theform = document.forms["Form1"];
 }
else 
{
   theform = document.Form1;
 }请问这就话是什么意思if (window.navigator.appName.toLowerCase().indexOf("netscape") > -1) 其中的"netscape"又是什么意思,是固定的吗?

解决方案 »

  1.   

    是判断 客户端浏览器 如果是 natscape 那么
    theform = document.forms["Form1"];
      

  2.   

    先声明了一个变量theform,如果当前客户端的游览器是网景(netscape)浏览器,那么就把document.forms["Form1"]这个对象赋给theform,否则就把document.Form1赋给它,之所有要这样写,是因为网景浏览器不支持 document.Form1这样的方式来获取文档对象。
      

  3.   

    判断浏览器是支持 ie 还是支持 netscape 网景