常用JavaScript函数31-46.doc
上传人:sy****28 上传时间:2024-09-14 格式:DOC 页数:270 大小:6.7MB 金币:16 举报 版权申诉
预览加载中,请您耐心等待几秒...

常用JavaScript函数31-46.doc

常用JavaScript函数31-46.doc

预览

免费试读已结束,剩余 260 页请下载文档后查看

16 金币

下载此文档

如果您无法下载资料,请参考说明:

1、部分资料下载需要金币,请确保您的账户上有足够的金币

2、已购买过的文档,再次下载不重复扣费

3、资料包下载后请先用软件解压,在使用对应软件打开

http://justcoding.javaeye.com/blog/56533931、获得当前日期32、jquery操作radio33、双击滚屏34、框架显示/隐藏35、JavaScript中的var_dump36、为JavaScript添加in_array支持二维数组37、支持div的抖动38、JavaScript中的empty();39、inputorarea显示/隐藏提示信息40、str_replace41、implode/explode42、全选43、去除数组中的重复项44、用JavaScript动态加载CSS和JS文件45、用JavaScript生成菜单树(build_file_tree)需要得到JSON46、textarea自动适应高度31、获得当前日期<scriptlanguage='javascript'>functionstartTime(){vartoday=newDate();vary=today.getFullYear();varm=today.getMonth();vart=today.getDate();vard=today.getDay();varh=today.getHours();vari=today.getMinutes();vars=today.getSeconds();varweekday={'0':'星期日','1':'星期一','2':'星期二','3':'星期三','4':'星期四','5':'星期五','6':'星期六'};//addazeroinfrontofnumber<10i=checkTime(i);s=checkTime(s);document.getElementById('txt').innerHTML='今天是:'+y+'年'+m+'月'+t+'日'+weekday[d]+';现在的时间是'+h+':'+i+':'+s;t=setTimeout('startTime()',1000);}functioncheckTime(i){if(i<10){i='0'+i;}returni;}</script><bodyonload='startTime()'><divid='txt'></div><br><br></body>详细参考:HYPERLINK"http://justcoding.javaeye.com/category/%E8%AF%A6%E7%BB%86%E5%8F%82%E8%80%83%EF%BC%9A%20http:/www.w3school.com.cn/js/jsref_obj_date.asp"\t"_blank"http://www.w3school.com.cn/js/jsref_obj_date.asp32、jquery操作radio检测单个radio是否选中<scriptsrc="http://code.jquery.com/jquery-latest.js"></script><scripttype="text/javascript">$(function(){if($('input[name=Number]').attr('checked')){//dosomething}else{//dosomething}})</script><inputname="Number"type="radio"value="50">50检测多个radio是否选中<scriptsrc="http://code.jquery.com/jquery-latest.js"></script><scripttype="text/javascript">$(function(){if($('input[name=Number_of_Employees]:checked').length!=1){//dosomething}else{//dosomething}})</script><inputname="Number"type="radio"value="50">50<inputname="Number"type="radio"value="250">250<inputname="Number"type="radio"value="40">450获