如何获得javascript各种对象(可当参考用)
将下面代码拷贝到一个HTM页面即可,代码如下:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>JAVASCRIPT对象</title>
<style>
<!--
body { font-family: Verdana; font-size: 11px }
th { font-family: Verdana; font-size: 11px;padding:3px;color:#FFFFFF;background-color:#999999;}
td { font-family: Verdana; font-size: 11px;padding:3px;background-color:#EFEFEF;}
-->
</style>
</head>
<BODY style="overflow:auto;" topmargin=2 bgcolor=buttonface>
<OBJECT classid=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA class=OBJECT id=RealPlayer width=0 height=0></OBJECT>
<button onclick="get(document)">document</button>
<button onclick="get(navigator)">navigator</button>
<button onclick="get(event)">event</button>
<button onclick="get(window)">Window</button>
<button onclick="get(location)">location</button>
<button onclick="get(RealPlayer)">RealPlayer</button>
<A HREF="http://www.webjx.com/" title="链接文字" onclick="get(this);return false">链接文字</A>
<IMG onclick=get(this) SRC="C:/Documents and Settings/Administrator.CHANGEGATE/桌面/Data_1.gif" style="width:10">
<INPUT TYPE="submit" onclick=get(this)>
<script defer>
function get(obj)
{
var Str="<table border="0" cellpadding="0" cellspacing="1" bgcolor="#000000">"
for(var i in obj)
//if (obj[i]!=null&obj[i]!="[object]")
Str+="<tr><td>"+i+"</td><td>"+obj[i]+" </td></tr>n"
Str+="</table>"
showzone.innerHTML = (Str)
}
</script>
<br>
<div id=showzone></div>
</BODY>
</HTML>
- 上一篇: 强制点击广告方法
- 下一篇: 页面无刷新调用数据(IFRAME+js)