最近参加了一个Web开发的客户端基础技术测试,虽然对于做前台开发的程序员来说比较简单,但对于一直做后台代码编写的程序员想掌握前台开发的基础来说,应该是一个比较好的Demo。对于Web初学者来说,也是一个概括比较全的示例。
先看看具体要求,这里直接把测试要求发了上来。需要注意的是,不能使用Dreamware或者Visual Studio智能工具,最好使用记事本纯手工编写,最多使用EditPlus辅助一下。

下面是我所完成的一个效果:

下面是我的实现代码:












































































































































































































































相关说明:
为了简单起见,我将Javascript 和CSS 都集成到HTML 当中来了。在实际的开发中,建议还是将他们分别用单独的文件存放,再在HTML 中引用进来。
CSS 的外部引用:
在HTML的<head>中添加<link rel="stylesheet" type="text/css" href="style.css">,然后把CSS 写在style.css文件中即可。
Javascript 的外部引用:
在HTML的<head>中添加<script type="text/javascript" src="Queue.js"></script>,然后把Javascript 写在Queue.js文件中即可。
也可以动态加载JS脚本(参考):
动态加载JS脚本的4种方法
如何在HTML文件中正确的引用js文件中的函数
另外,为了阅读的方便,我在代码中添加了许多的注释。关于注释,在HTML、Javascript 和CSS 中都有所差异:
HTML 中使用: <!-- HTML的注释 -->
Javascript 中使用: /* JavaScript的注释 */ 和 // JavaScript的注释
CSS 中使用: /* CSS的注释 */
( 关于HTML、Javascript 和CSS 的注释是我在应用后的总结,错漏之处还请斧正!)
本文转自钢钢博客园博客,原文链接:http://www.cnblogs.com/xugang/archive/2008/05/12/1193506.html,如需转载请自行联系原作者