javascript使用(web端)

javascript使用(web端)

ID:11531601

大小:78.00 KB

页数:13页

时间:2018-07-12

javascript使用(web端)_第1页
javascript使用(web端)_第2页
javascript使用(web端)_第3页
javascript使用(web端)_第4页
javascript使用(web端)_第5页
资源描述:

《javascript使用(web端)》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、JS技术文档2014_20161.取字符串中某两个字串之间的值/*函数功能:截取字符串中两个字串中间的字符串信息。输入传参:1、ret:需要截取的字符串;2、strs:开始字符串;3、stre:结束字符串。输出返回值:dep,根据传参的值,返回给调用的值为dep。CreatedBy:suhuaat2013-01-29*/functiongetSubstr(ret,strs,stre){vardeps=ret.indexOf(strs)+strs.length;//如果结束字符为空,则取从开始字符到结束字符的所有字符串if(stre=="")vardepe=ret.length;el

2、sevardepe=ret.indexOf(stre);vardep=ret.substr(deps,depe-deps);returndep;}2.GB2132编码functionURLEncode(sstr){unicodestr="";for(i=0;i

3、r.charAt(i);[苏州三全友软件科技开发有限公司]13/1313/13JS技术文档2014_2016if(chr=="+"){ret+="";}elseif(chr=="%"){varasc=str.substring(i+1,i+3);if(parseInt("0x"+asc)>0x7f){ret+=asc2str(parseInt("0x"+asc+str.substring(i+4,i+6)));i+=5;}else{ret+=asc2str(parseInt("0x"+asc));i+=2;}}else{ret+=chr;}}returnret;}1.页面上ifra

4、me自适应高度的JSfunctionreinitIframe(){variframe=document.getElementById("mainFrame");try{varbHeight=iframe.contentWindow.document.body.scrollHeight;vardHeight=iframe.contentWindow.document.documentElement.scrollHeight;varheight=Math.max(bHeight,dHeight);iframe.height=h

5、eight;}catch(ex){}}window.setInterval("reinitIframe()",200);2.单选按钮选择//处理单选按钮的选择,suhuaadd213-09-10functionSelectChecked(){varvalue="";varradio=document.getElementsByName("fldYjFlag");//alert(radio.length);for(vari=0;i

6、[i].checked==true){value=radio[i].value;break;}}//alert(value);//如果选择的“否”,隐藏下面的信息/*if(value=="0"){varmainid=document.getElementById("fw");varhqid=document.getElementById("yzyj");mainid.style.display="none";hqid.style.display="none";}*///如果选择的“是”,给下面单选按钮赋值if(value=="1"){/*varmainid=document.get

7、ElementById("fw");varhqid=document.getElementById("yzyj");if(mainid.style.display=="none"){mainid.style.display="block";hqid.style.display="block";}*/varradio1=document.getElementsByName("fldYzYjFlag");for(vari=0;i

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。