首页 美女贴图 网络日记 重庆租房 搜索指南 网络电视 飘网音乐 飘网博客 精彩网址 友情链接 飘网地图 本站留言
飘网中国
专题:网络营销 | 网站设计 | QQ技巧 | 搜索优化 | 菜鸟进阶 | 病毒攻防 | 网络技术 | 系统应用 | 本站作品 | 常用软件 | 工具软件 |
飘网中国>>网站设计>>正文

入门教程:Javascript学习讲解(二)

编辑:Admin 来源:蓝色理想 更新:2007-9-5 点击:
【字体:

摘要:清华大学出版的《事半功倍系列 javascript》,本人照着书敲出来的,有些翻译了一下.前几年看了一下,最近无事,重新翻了翻,很有帮助.本书应该有光盘的,但学校的书,光盘不知在哪.希望对你学 javascript有帮助
关键字:Javascript学习 js 
正文:
第八章 使用窗口

1.在浏览器的状态栏上显示文本

<body onload=window.status="欢迎光临我的站点">
<a href=http://www.sohu.com>sohu</a>
</body>
2.改变背景色

<script>
document.bgColor="orange"
</script>
3.列举背景颜色

<body bgColor =green>
<script>
document.write("当前背景色是:"+document.bgColor)
</script>
</body>
4.改变文本和链接颜色

<script>
document.bgColor="orange"
document.fgColor="blue"
document.linkColor="red"
</script>
<h2>看看这段文本颜色</h2>
<a href=http://www.sohu.com>sohu</a>
</body>
5.改变文档标题

<script>
name="Mouse"
document.title="welcome to "+name+"'s House"
document.write(document.title)
</script>
6.显示修改日期

<script>
document.write("本页面最后修改时间是"+document.lastModified)
</script>
7.查看当前文档的URL

<script>
document.write("本页面的URL:"+document.URL)
</script>
8.查看引用页

<script>
document.write("本页面的引用页是"+document.referrer)
</script>
9.打开新的浏览器窗口

<script>
window.open("*.htm","title","width=200,height=400,resizable=yes")
</script>
10.关闭远程窗口


close.html:
<script>
document.write("正文")
</script>
<form name=form1>
<input type=button name=button1value="关闭" onclick=window.close()>
</form>

open.html
<script>
window.open("close.html","romote","width=200,height=400,resizable=yes")
</script>
11.打印窗口

<script>
document.write("正文")
</script>
<form name=form1>
<input type=button value=打印 onclick=window.print()>
</form>
12.移动窗口


<form name=form1>
水平方向<input type=text name=x value=20>
垂直方向<input type=text name=y value=50>
<input type=button value="移动窗口到…"onclick=window.moveTo(document.form1.x.value,document.form1.y.value)>
</form>

<form name=form1>
水平方向<input type=text name=x value=20>
垂直方向<input type=text name=y value=50>
<input type=button value="移动窗口"onclick=window.moveBy(document.form1.x.value,document.form1.y.value)>
</form>

13.改变窗口大小


<form name=form1>
水平方向<input type=text name=x value=200>
垂直方向<input type=text name=y value=500>
<input type=button value="改变窗口大小到….."onclick=window.resizeTo(document.form1.x.value,document.form1.y.value)>
[1][2][3][4][5][6][7][8]
上一篇:入门教程:Javascript学习讲解(一)
下一篇:Sql Server数据库的备份、恢复方法
最新文章 更多
推荐文章 更多
热门文章 更多
© 2005-2010 飘网中国 版权所有
站长邮箱:①LCC-749AT163.com ②FlymornATgmail.com(AT改为@)
如转载时,请注明出处;本站部分资源来自网络,如有侵权,请来信说明;飘易文章系统 HTML版.
渝ICP备05000119号