IE 对象浏览器

[入库:2005年8月18日] [更新:2007年3月24日]

本文简介:选择自 skimeister 的 blog

本对象浏览器可列出ie的绝大部分对象及属性
点击对象名可查看本对象内容..
有不完善之处,请各位指正
qq:3960937
mail:fsca@21cn.com
msn:vlike@msn.com

===============================================================

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<title>object viewer for ie</title>
<style>
mtd{font-size:12px}
</style>
</head>
<body onclick="getchil();">
<input type="text" id="obj" value="window" onclick="this.select();">
<input type="button" id="goview" onclick="showobject(obj.value);" value="查看">
<input type="button" onclick="rtparent()" value="返回">
<script language="javascript">
<!--
 //................................
 //author:skimeister|fsca@21cn.com
 //2002-5-21
 //................................

 //enter the child
 function getchil()
 {
  if(eval(event.srcelement.isobj))
  {
   objval=obj.value+"."+event.srcelement.innertext;
   obj.value=objval;
   showobject(obj.value);
  }
 }//getchil

 //kill the lt.gt tag
 function process(val)
 {
  try
  {
   if(val!="" && isnan(val))
   {
    lt=/</g;
    rt=/>/g;
    val+=" ";
    val=val.replace(lt,"&lt;");
    val=val.replace(rt,"&gt;");
   }//end if
  }//end try
  catch(e)
  {
   val="[空]";
  }
  return val;
 }//process

 //return parent
 function rtparent()
 {
  var mvalue="";
  mobj=obj.value;
  mobj=mobj.split(".");
  mlength=mobj.length-1;
  for(i=0;i<mlength;i++)
  {
   mvalue==""?mvalue=mobj[i]:mvalue+="."+mobj[i];
  }
  mvalue==""?mvalue="window":"";
  obj.value=mvalue;
  showobject(mvalue);
 }//rtparent

 //show object
 function showobject(textobj)
 {
  var htmls="";
  var obj=eval(textobj);
  var mbg="";
  var isobj=false;
  var j=0;
  try
  {
   for(i in obj)
   {
    j++;
    try
    {
     obj[i]=="[object]"?mbg="#d8d8eb":mbg="";
     obj[i]=="[object]"?isobj=true:isobj=false;
    }
    catch(e)
    {
     //alert("对不起!!程序未完善或\n此对象存在问题\n错误类型:"+e.message);
    }
    pestr=process(obj[i]);
    htmls+="<tr bgcolor='"+mbg+"'><td width='5'>"+j+"</td><td isobj='"+isobj+"'>"+i+"</td><td>"+pestr+"&nbsp;</td></tr>";
   }
  }//end try
  catch(e)
  {
   alert("访问对象出错/程序未善,请指教\nfsca@21cn.com");
  }
  htmls=""
  +"<table border='1'><tr><td colspan='3' bgcolor='#cccccc' align='center'>"
  +textobj
  +"</td>"
  +htmls
  +"</table>";
  showplan.innerhtml=htmls;
 }//showobject
//-->
</script>
<span id="showplan"></span>
<div align="center" style="font-size:12px;background-color:#f7f7f7">power by <a href="mailto:fsca@21cn.com">fsca@21cn.com</a></div>
</body>
</html>

本文关键:对象
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top