• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
安安的BLOG
安安目前专注电子商务解决方案^_^
博客园    首页    新随笔    联系   管理    订阅  订阅

在b/s开发中经常用到的javaScript技术(转载2)

二、功能类

1、时间与相关控件类
1.1 日历(例如:梅花雪日历控件)
1.2 时间控件
1.3 万年历
1.4 显示动态显示时钟效果(文本,如OA中时间)
1.5 显示动态显示时钟效果 (图像,像手表)
2、表单类
2.1 自动生成表单
2.2 动态添加,修改,删除下拉框中的元素
2.3 可以输入内容的下拉框
2.4 多行文本框中只能输入iMax文字。如果多输入了,自动减少到iMax个文字(多用于短信发送)

3、打印类
3.1 打印控件

4、事件类
4.1 屏蔽右键
4.2 屏蔽所有功能键
4.3 --> 和<-- F5 F11,F9,F1
4.4 屏蔽组合键ctrl+N

5、网页设计类
5.1 连续滚动的文字,图片(注意是连续的,两段文字和图片中没有空白出现)
5.2 html编辑控件类
5.3 颜色选取框控件(可以参考FreeTextBox或者RichTextBox的颜色选取框控件来实现)
5.4 下拉菜单
5.5 两层或多层次的下拉菜单
5.6 仿IE菜单的按钮。(效果如rongshuxa.com的导航栏目)
5.7 状态栏,title栏的动态效果(例子很多,可以研究一下)
5.8 双击后,网页自动滚屏

6、树型结构。(例如:梅花雪树型控件)
6.1 asp+SQL版
6.2 asp+xml+sql版
6.3 java+sql或者java+sql+xml

7、无边框效果的制作(结合CSS)

8、连动下拉框技术

9、文本排序

10,画图类,含饼、柱、矢量贝滋曲线

11,操纵客户端注册表类

12,DIV层相关(拖拽、显示、隐藏、移动、增加)

13,TABLAE相关(客户端动态增加行列,模拟进度条,滚动列表等)
<HTML>
<SCRIPT LANGUAGE=JScript>
function numberCells() {
    var count=0;
    for (i=0; i < document.all.mytable.rows.length; i++) {
        for (j=0; j < document.all.mytable.rows(i).cells.length; j++) {
            document.all.mytable.rows(i).cells(j).innerText = count;
            count++;
        }
    }
}
</SCRIPT>
<BODY onload=numberCells()>
<TABLE id=mytable border=1>
<TR><TH>&nbsp;</TH><TH>&nbsp;</TH><TH>&nbsp;</TH><TH>&nbsp;</TH></TR>
<TR><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR>
<TR><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR>
</TABLE>
</BODY>
</HTML>

14,各种<object classid=>相关类,如播放器,flash与脚本互动等


16, 刷新/模拟无刷新 异步调用类(XMLHttp或iframe,frame)

画图:
<OBJECT
id=S
style=LEFT: 0px; WIDTH: 392px; TOP: 0px; HEIGHT: 240px
height=240
width=392
classid=clsid:369303C2-D7AC-11D0-89D5-00A0C90833E6>
</OBJECT>
<SCRIPT>
S.DrawingSurface.ArcDegrees(0,0,0,30,50,60);
S.DrawingSurface.ArcRadians(30,0,0,30,50,60);
S.DrawingSurface.Line(10,10,100,100);
</SCRIPT>
写注册表:
<SCRIPT>
var WshShell = WScript.CreateObject(WScript.Shellscreen.width/2)this.width=screen.width/2 vspace=2 border=0>;
WshShell.RegWrite (HKCU\\Software\\ACME\\FortuneTeller\\, 1, REG_BINARYscreen.width/2)this.width=screen.width/2 vspace=2 border=0>;
WshShell.RegWrite (HKCU\\Software\\ACME\\FortuneTeller\\MindReader, Goocher!, REG_SZscreen.width/2)this.width=screen.width/2 vspace=2 border=0>;
var bKey =    WshShell.RegRead (HKCU\\Software\\ACME\\FortuneTeller\\screen.width/2)this.width=screen.width/2 vspace=2 border=0>;
WScript.Echo (WshShell.RegRead (HKCU\\Software\\ACME\\FortuneTeller\\MindReaderscreen.width/2)this.width=screen.width/2 vspace=2 border=0>);
WshShell.RegDelete (HKCU\\Software\\ACME\\FortuneTeller\\MindReaderscreen.width/2)this.width=screen.width/2 vspace=2 border=0>;
WshShell.RegDelete (HKCU\\Software\\ACME\\FortuneTeller\\screen.width/2)this.width=screen.width/2 vspace=2 border=0>;
WshShell.RegDelete (HKCU\\Software\\ACME\\screen.width/2)this.width=screen.width/2 vspace=2 border=0>;
</SCRIPT>

1.身份证严格验证:

var aCity={11:北京,12:天津,13:河北,14:山西,15:内蒙古,21:辽宁,22:吉林,23:黑龙江,31:上海,32:江苏,33:浙江,34:安徽,35:福建,36:江西,37:山东,41:河南,42:湖北,43:湖南,44:广东,45:广西,46:海南,50:重庆,51:四川,52:贵州,53:云南,54:西藏,61:陕西,62:甘肃,63:青海,64:宁夏,65:新疆,71:台湾,81:香港,82:澳门,91:国外}
 
function cidInfo(sId){
 var iSum=0
 var info=
 if(!/^\d{17}(\d|x)$/i.test(sId))return false;
 sId=sId.replace(/x$/i,ascreen.width/2)this.width=screen.width/2 vspace=2 border=0>;
 if(aCity[parseInt(sId.substr(0,2))]==null)return Error:非法地区;
 sBirthday=sId.substr(6,4)+-+Number(sId.substr(10,2))+-+Number(sId.substr(12,2));
 var d=new Date(sBirthday.replace(/-/g,/screen.width/2)this.width=screen.width/2 vspace=2 border=0>)
 if(sBirthday!=(d.getFullYear()+-+ (d.getMonth()+1) + - + d.getDate()))return Error:非法生日;
 for(var i = 17;i>=0;i --) iSum += (Math.pow(2,i) % 11) * parseInt(sId.charAt(17 - i),11)
 if(iSum%11!=1)return Error:非法证号;
 return aCity[parseInt(sId.substr(0,2))]+,+sBirthday+,+(sId.substr(16,1)%2?男:女screen.width/2)this.width=screen.width/2 vspace=2 border=0>
}
document.write(cidInfo(380524198002300016screen.width/2)this.width=screen.width/2 vspace=2 border=0>,<br/>screen.width/2)this.width=screen.width/2 vspace=2 border=0>;
document.write(cidInfo(340524198002300019screen.width/2)this.width=screen.width/2 vspace=2 border=0>,<br/>screen.width/2)this.width=screen.width/2 vspace=2 border=0>
document.write(cidInfo(340524197711111111screen.width/2)this.width=screen.width/2 vspace=2 border=0>,<br/>screen.width/2)this.width=screen.width/2 vspace=2 border=0>
document.write(cidInfo(34052419800101001xscreen.width/2)this.width=screen.width/2 vspace=2 border=0>,<br/>screen.width/2)this.width=screen.width/2 vspace=2 border=0>;

2.验证IP地址
<SCRIPT LANGUAGE=javascript>
function isip(s){
 var check=function(v){try{return (v<=255 && v>=0)}catch(x){return false}};
 var re=s.split(.screen.width/2)this.width=screen.width/2 vspace=2 border=0>
 return (re.length==4)?(check(re[0]) && check(re[1]) && check(re[2]) && check(re[3])):false
}
var s=202.197.78.129;
alert(isip(s))
</SCRIPT>
 
3.加sp1后还能用的无边框窗口!!
<HTML XMLNS:IE>
<meta http-equiv=Content-Type content=text/html; charset=gb2312>
<I

posted @ 2006-02-25 15:31  安安  阅读(251)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3