![]() |
#2
cnfarer2012-10-31 07:22
|

<html>
<head>
<title>
Using Properties
</title>
<script language="javascript">
outputWindow = open("", "output")
function setupWindow()
{
outputWindow.document.write("<html><head><title>Output Window</title></head><body>)
}
function describeNavigator()
{
outputWindow.document.write("<h2>Brower Properties</h2>")
outputWindow.document.write(navigator.appCodeName+ " ")
outputWindow.document.write(navigator.appName + " ")
outputWindow.document.write(navigator.appVersion + "<br>")
outputWindow.document.write(navigator.mimeTypes.length + " MIME types aer defined. ")
outputWindow.document.write(navigator.plugins.length + " plug-ins are in-stalled.")
}
function describeWindow()
{
outputWindow.document.write("<h2>Window Properties</h2>")
outputWindow.document.write("Frames: " + frames.length + "<br>")
outputWindow.document.write("URL: " + location.href + "<br>")
}
function describeDocument()
{
outputWindow.document.write("<h2>Document Properties</h2>")
describeLinks()
describeForms()
}
function describeLinks()
{
outputWindow.document.write("<h3>Links</h3>")
outputWindow.document.write("This document contains" + document.links.length + " links:<br>")
for (i = 0; i < document.links.length; ++i)
{
outputWindow.document.write(document.links[i].href + "<br>")
}
}
function describeForms()
{
outputWindow.document.write("Form " + n + " has " + document.forms[n].elements.length + " elements:")
for (j = 0; j < document.forms[n].elements.length; ++j)
{
outputWindow.document.write(" " + document.forms[n].elements[j].name)
}
outputWindow.document.write("<br>")
}
function finishWindow()
{
outputWindow.document.write("<form><input type='button' value='Close Window' onclick='window.close()'></form>")
outputWindow.document.write("</body></html>")
}
</script>
</head>
<body>
<h1>Using Hierarchical Object Identifiers</h1>
<p>
<a href="http://www.baidu.com">Link to baidu.com.</a>
</p>
<p>
<a href="https://bbs.bccn.net">Link to bccn.net</a>
</p>
<form>
<p>
<input type="text" name="textField1" value="Enter text here!">
</p>
<p>
<input type="checkbox" name="checkbox1" checked="checked">I'm checkbox1.
</p>
<p>
<input type="checkbox" name="checkbox2">I'm checkbox2
</p>
<input type="submit" name="submitButton" value="Click here!">
</form>
<script language="javascript">
setupWindow()
describeBrowser()
describeWindow()
describeDocument()
finsihWindow()
</script>
</body>
</html>
<head>
<title>
Using Properties
</title>
<script language="javascript">
outputWindow = open("", "output")
function setupWindow()
{
outputWindow.document.write("<html><head><title>Output Window</title></head><body>)
}
function describeNavigator()
{
outputWindow.document.write("<h2>Brower Properties</h2>")
outputWindow.document.write(navigator.appCodeName+ " ")
outputWindow.document.write(navigator.appName + " ")
outputWindow.document.write(navigator.appVersion + "<br>")
outputWindow.document.write(navigator.mimeTypes.length + " MIME types aer defined. ")
outputWindow.document.write(navigator.plugins.length + " plug-ins are in-stalled.")
}
function describeWindow()
{
outputWindow.document.write("<h2>Window Properties</h2>")
outputWindow.document.write("Frames: " + frames.length + "<br>")
outputWindow.document.write("URL: " + location.href + "<br>")
}
function describeDocument()
{
outputWindow.document.write("<h2>Document Properties</h2>")
describeLinks()
describeForms()
}
function describeLinks()
{
outputWindow.document.write("<h3>Links</h3>")
outputWindow.document.write("This document contains" + document.links.length + " links:<br>")
for (i = 0; i < document.links.length; ++i)
{
outputWindow.document.write(document.links[i].href + "<br>")
}
}
function describeForms()
{
outputWindow.document.write("Form " + n + " has " + document.forms[n].elements.length + " elements:")
for (j = 0; j < document.forms[n].elements.length; ++j)
{
outputWindow.document.write(" " + document.forms[n].elements[j].name)
}
outputWindow.document.write("<br>")
}
function finishWindow()
{
outputWindow.document.write("<form><input type='button' value='Close Window' onclick='window.close()'></form>")
outputWindow.document.write("</body></html>")
}
</script>
</head>
<body>
<h1>Using Hierarchical Object Identifiers</h1>
<p>
<a href="http://www.baidu.com">Link to baidu.com.</a>
</p>
<p>
<a href="https://bbs.bccn.net">Link to bccn.net</a>
</p>
<form>
<p>
<input type="text" name="textField1" value="Enter text here!">
</p>
<p>
<input type="checkbox" name="checkbox1" checked="checked">I'm checkbox1.
</p>
<p>
<input type="checkbox" name="checkbox2">I'm checkbox2
</p>
<input type="submit" name="submitButton" value="Click here!">
</form>
<script language="javascript">
setupWindow()
describeBrowser()
describeWindow()
describeDocument()
finsihWindow()
</script>
</body>
</html>