会员
周边
捐助
新闻
博问
闪存
赞助商
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
clear93
博客园
首页
新随笔
联系
管理
上一页
1
···
4
5
6
7
8
9
下一页
2015年7月7日
实现窗口中的文档自动向上滚动,方便阅读
摘要: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.or
阅读全文
posted @ 2015-07-07 12:00 程序猿凯
阅读(376)
评论(0)
推荐(0)
编辑
2015年7月6日
处理文本框的鼠标事件,判断鼠标的状态
摘要: <script> function dclick() { form1.text.value = "您双击了页面!"; } function Click() { form1.text.value += "您单击了页面"; } function down() { form1.text.value = "
阅读全文
posted @ 2015-07-06 16:07 程序猿凯
阅读(412)
评论(0)
推荐(0)
编辑
通过给事件处理程序传递this参数,获取事件源对象的引用。单机提交按钮时在信息框中显示用户输入的字符。
摘要: <script> function mymethod(str) { alert("您输入的是:"+str); } </script><form action="" method="get"><!-- 调用mymethod()函数this.value取得当前对象的值做参数 --><input type
阅读全文
posted @ 2015-07-06 15:18 程序猿凯
阅读(321)
评论(0)
推荐(0)
编辑
在标签的事件属性字符串中编写程序,检查用户输入的密码明文
摘要: <body> <form action="" id="form1" name="form1" method="post"> <label>姓名: <input type="text" name="textfield" /> </label> <p> <label>密码: <input type="p
阅读全文
posted @ 2015-07-06 14:29 程序猿凯
阅读(249)
评论(0)
推荐(0)
编辑
通过使用浏览器对象模型,输出当前浏览器窗口中打开的文档的URL信息,并将显示在窗口中。
摘要: <script type="text/javascript">window.document.write("这个网页文件来自:".bold());window.document.write(window.location.toString());</script>
阅读全文
posted @ 2015-07-06 13:32 程序猿凯
阅读(228)
评论(0)
推荐(0)
编辑
创建一个卡片对象,卡片上标有“名字”、“地址”和“电话”等信息。名片对象提供一个方法以输出这些信息。
摘要: <script type="text/javascript"> function Card(name, address, phone) { this.name = name; //初始化名片信息 this.address = address; this.phone = phone; this.pri
阅读全文
posted @ 2015-07-06 11:10 程序猿凯
阅读(378)
评论(0)
推荐(0)
编辑
2015年7月3日
测试Array对象的sort方法的作用。将1985,1970,1999,1998,2000,1963这些年份按升序输出。
摘要: <script type="text/javascript">var years = new Array(1985,1970,1999,1998,2000,1963);document.write("排序前的各年份:<li>" + years+"</li>");function sortFunc(
阅读全文
posted @ 2015-07-03 16:40 程序猿凯
阅读(338)
评论(1)
推荐(0)
编辑
2015年7月2日
模拟售票窗口前的顾客队列,在队列最前面的人最先买到票。已经买到票的顾客出队,当库存票售完或队伍里没人则停止销售。
摘要: <script>var queue = new Array(); //购票队列function client(name) //顾客对象{ this.name = name; //顾客名字 this.ticket = NaN; //票号}queue.push(new client("Lily"),ne
阅读全文
posted @ 2015-07-02 09:25 程序猿凯
阅读(338)
评论(0)
推荐(0)
编辑
2015年6月25日
使用arguments对象验证函数的参数是否合法
摘要: <script>function sum(arg1,arg2) //加法函数{ var realArgCount = arguments.length; //调用函数时传递的实参个数 var frmArgCount = sum.length; //函数定义时的形参个数 if(realArgCount
阅读全文
posted @ 2015-06-25 15:57 程序猿凯
阅读(310)
评论(1)
推荐(0)
编辑
编写一个排序函数,实现数字排序。排序方法由客户函数实现,函数参数个数为两个,两个参数的关系作为排序后的元素间的关系。
摘要: <script>function SortNumber(obj,func) //定义通用排序函数{ //参数验证,如果第一个参数不是数组或第二个参数不是函数则抛出异常 if(!(obj instanceof Array) || !(func instanceof Function)) { var e
阅读全文
posted @ 2015-06-25 14:57 程序猿凯
阅读(935)
评论(0)
推荐(0)
编辑
上一页
1
···
4
5
6
7
8
9
下一页
公告