您的位置:首页 > Web前端 > JavaScript

JavaScript学习笔记 5-DOM,窗口 和 框架

2008-10-02 23:27 671 查看
(内容来源网络,经过重新整理,可任意转摘,但请注明出处:http://www.cnblogs.com/tograce/category/157013.html)
这一节的内容是介绍:Document Object Model, Windows, and Frames

JavaScript窗口操作介绍(Introduction to Window Manipulation)

先回顾在html中是如何使用框架的:

默认页面的代码是:

<html>

<head>

<title>day_3_homework_default</title>

</head>

<body>

<h1>Your Homework Assignment</h1>

<p>Make this page work. If you click on the monkey in the right corner of the page, you'll go to the branding

page from last lesson's homework. If you hit the Home button, you'll come back here. The yellow and green

buttons change the background color of this page.<br><br>

Get these buttons to work, and then View Source to see what I did. </p>

</body>

</html>

-----------------

另一页面的代码是:

<html>

<head>

<title>day_3_homework_brandme</title>

<script language="javascript">

<!--

var image1="image/monkey.gif";

var image2="image/thau.gif";

var image3="image/sun.gif";

-->

</script>

</head>

<body>

<h1>Browser Configuration</h1>

<p>Brand your browser by moving your mouse over the image below until you find one you like. Then click on

the image.</p>

<a href="#" onMouseOver="temp=image1;image1=image2;image2=image3;image3=temp;

window.document.the_image.src=image1;"

onclick="parent.control_frame.document.brandme_img.src=image1;">

<img src="image/monkey.gif" name="the_image" border="0"></a>

</body>

</html>

上面的代码里有很多学习点,值得认真琢磨
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: