JavaScript<2.1>

* history

常用方法  

名称

说      明

back()

加载 history 对象列表中的前一个URL

forward()

加载 history 对象列表中的下一个URL

go()

加载 history 对象列表中的某个具体URL


* location 对象

常用属性

名称

说      明

host

设置或返回主机名和当前URL的端口号

hostname

设置或返回当前URL的主机名

href

设置或返回完整的URL

常用方法

名称

说      明

reload()

重新加载当前文档

replace()

用新的文档替换当前文档


* Document 对象

常用属性

名称

说      明

referrer

返回载入当前文档的文档的URL

URL

返回当前文档的URL

语法:document.referrer document.URL

常用方法

名称

说      明

getElementById()

返回对拥有指定id的第一个对象的引用

getElementsByName()

返回带有指定名称的对象的集合

getElementsByTagName()

返回带有指定标签名的对象的集合

write()

向文档写文本、HTML表达式或JavaScript代码


* JavaScript内置对象

Array:用于在单独的变量名中存储一系列的值。

String :用于支持对字符串的处理。
Math :用于执行常用的数学任务,它包含了若干个数字常量和函数。
Date :用于操作日期和时间。

按下表要求布置拓扑,并配置 Web 服务器(index.html 代码已给出)。访问 Web 服 务器,单击“点此调用 javascript 方法”按钮。 设备名称 端口 IP 地址 默认网关 Fa0/0 192.168.1.254/24路由器 R0 Fa0/1 192.168.2.1/24 路由器 R1 Fa0/0 192.168.3.254/24 Fa0/1 192.168.2.2/24 PC0 Fa0 192.168.1.1/24 192.168.1.254 HTTP server Fa0 192.168.3.1/24 192.168.3.254/24 index.html 代码 <html> <center><font size='+2' color='blue'> Cisco Packet Tracer</font></center> <hr>Welcome to Cisco Packet Tracer. Opening doors to new opportunities. Mind Wide Open. <p>Quick Links: <br><a href='helloworld.html'>A small page</a> <br><a href='copyrights.html'>Copyrights</a> <br><a href='image.html'>Image page</a> <br><a href='cscoptlogo177x111.jpg'>Image</a> <br><br> <b>Testing HTML pages with Javascript and Stylesheet</b> <ul> <li><button type="button" onclick="myFunction()">点此调用javascript方法</button> <script> function myFunction() { alert ("兄 der, 调用成功!"); } </script> <li><a href="index2.html">HTML page with an external javascript file (index2.html) </a> <li><a href="index3.html">HTML page with an external stylesheet file (index3.html) </a> <li><a href="index4.html">HTML page with both external javascript and stylesheet files (index4.html) </a> <li><a href='image.html'>Image page: Test for a previously saved file with the image file in the directory of the pkt file</a> <li><a href='image2.html'>Image page: Test for with the image file imported in the PT Server</a> </html>
05-29
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值