How to obtain various JavaScript objects (for reference)

Source: Internet
Author: User

Copy the following code to an HTM page. The Code is as follows:

<HTML>
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312">
<Title> JavaScript Object </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://blog.csdn.net/great_domino/" Title = "link text" onclick = "Get (this); Return false"> link text </a>

<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] + "& nbsp; </TD> </tr>/N"
STR + = "</table>"
Showzone. innerhtml = (STR)
}
</SCRIPT>
<Br>
<Div id = showzone> </div>
</Body>
</Html>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.