javascript常用函数(2)

前端之家收集整理的这篇文章主要介绍了javascript常用函数(2)前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

文章主要内容列表:

16、 除去数组重复项 17、 操作cookie 18、 判断浏览器类型 19、 判断是否开启cookie 20、 断是否开启JavaScript 21、 JavaScript 打字机效果 22、 简单打印 23、 禁止右键 24、 防止垃圾邮件 25、复制(javaeye flash版) 26、 阻止冒泡事件或阻止浏览器默认行为 27、 关闭跳转窗口时提示 28、 用javascript获取地 址栏参数 29、 计算停留的时间 30、 div为空,只有背景时,背景自动增高

主要内容

16、除去数组重复项

Array.prototype.remove = function(){ var $ = this; var o1 = {}; var o2 = {}; var o3 = []; var o;

for(var i=0;o = $[i];i++){
if(o in o1){
if(!(o in o2)) o2[o] = o;
delete $[i];
}else{
o1[o] = o;
}
}

$.length = 0;

for(o in o1){
$.push(o);
}

for(o in o2){
o3.push(o);
}

return o3;

}

var a = [2,2,3,4,5,6,7,7];

a.remove ();

document.write(a);

@H_502_13@

17、 操作cookie

// 简单型

function setCookie(c_name,value,expiredays)
{
var exdate=new Date()
exdate.setDate(exdate.getDate()+expiredays)

document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString())
}

// 完整型
function SetCookie(name,expires,path,domain,secure)
{
var expDays = expires2460601000;

var expDate = new Date();
expDate.setTime(expDate.getTime()+expDays);

var expString = ((expires==null) ? "" : (";expires=”+expDate.toGMTString()))
var pathString = ((path==null) ? "" : (";path="+path))
var domainString = ((domain==null) ? "" : (";domain="+domain))
var secureString = ((secure==true) ? ";secure" : "" )
document.cookie = name + "=" + escape(value) + expString + pathString + domainString + secureString;
}

// 2.获取指定名称的cookie值:

function getCookie(c_name)
{
if (document.cookie.length>0)
{
c_start=document.cookie.indexOf(c_name + "=")
if (c_start!=-1)
{
c_start=c_start + c_name.length+1
c_end=document.cookie.indexOf(";",c_start)
if (c_end==-1) c_end=document.cookie.length
return unescape(document.cookie.substring(c_start,c_end))
}
}
return ""
}

// 3.删除指定名称的cookie:

function ClearCookie(name)
{
var expDate = new Date();
expDate.setTime(expDate.getTime()-100);

document.cookie=name+”=;expires=”+expDate.toGMTString();

}

// 4. 检测cookie:

function checkCookie()
{
username=getCookie('username')
if (username!=null && username!="")
{alert('Welcome again '+username+'!')}
else
{
username=prompt('Please enter your name:',"")
if (username!=null && username!="")
{
setCookie('username',username,365)
}
}
}
@H_502_13@

18、获取坐标

payment@H_<a href="https://www.jb51.cc/tag/404/" target="_blank" class="keywords">404</a>_27@ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <p><body style="font-size:12px;"> </p> <script> var strInfo=""; strInfo += "网页可见区域宽:" + document.body.clientWidth + "<br>"; strInfo += "网页可见区域高:" + document.body.clientHeight + "<br>"; strInfo += "网页可见区域宽:" + document.body.offsetWidth + "(<a href="https://www.jb51.cc/tag/baokuo/" target="_blank" class="keywords">包括</a>边线的宽)<br>"; strInfo += "网页可见区域高:" + document.body.offsetHeight + "(<a href="https://www.jb51.cc/tag/baokuo/" target="_blank" class="keywords">包括</a>边线的宽)<br>"; strInfo += "网页正文全文宽:" + document.body.scrollWidth + "<br>"; strInfo += "网页正文全文高:" + document.body.scrollHeight + "<br>"; strInfo += "网页被卷去的高:" + document.body.scrollTop + "<br>"; strInfo += "网页被卷去的左:" + document.body.scrollLeft + "<br>"; strInfo += "网页正文部分上:" + window.screenTop + "<br>"; strInfo += "网页正文部分左:" + window.screenLeft + "<br>"; strInfo += "屏幕分辨率的高:" + window.screen.height + "<br>"; strInfo += "屏幕分辨率的宽:" + window.screen.width + "<br>"; strInfo += "屏幕可用工作区高度:" + window.screen.availHeight + "<br>"; strInfo += "屏幕可用工作区宽度:" + window.screen.availWidth + "<br>"; <p>document.write(strInfo); </p> </script> <p><br><br> </p> <p> clientX 设置或<a href="https://www.jb51.cc/tag/huoqu/" target="_blank" class="keywords">获取</a>鼠标指针位置相对于窗口客户区域的 x 坐标,其中客户区域不<a href="https://www.jb51.cc/tag/baokuo/" target="_blank" class="keywords">包括</a>窗口自身的控件和滚动条。 <br> clientY 设置或<a href="https://www.jb51.cc/tag/huoqu/" target="_blank" class="keywords">获取</a>鼠标指针位置相对于窗口客户区域的 y 坐标,其中客户区域不<a href="https://www.jb51.cc/tag/baokuo/" target="_blank" class="keywords">包括</a>窗口自身的控件和滚动条。<br> offsetX 设置或<a href="https://www.jb51.cc/tag/huoqu/" target="_blank" class="keywords">获取</a>鼠标指针位置相对于触发事件的对象的 x 坐标。<br> offsetY 设置或<a href="https://www.jb51.cc/tag/huoqu/" target="_blank" class="keywords">获取</a>鼠标指针位置相对于触发事件的对象的 y 坐标。<br> screenX 设置或<a href="https://www.jb51.cc/tag/huoqu/" target="_blank" class="keywords">获取</a><a href="https://www.jb51.cc/tag/huoqu/" target="_blank" class="keywords">获取</a>鼠标指针位置相对于<a href="https://www.jb51.cc/tag/yonghu/" target="_blank" class="keywords">用户</a>屏幕的 x 坐标。<br> screenY 设置或<a href="https://www.jb51.cc/tag/huoqu/" target="_blank" class="keywords">获取</a>鼠标指针位置相对于<a href="https://www.jb51.cc/tag/yonghu/" target="_blank" class="keywords">用户</a>屏幕的 y 坐标。<br> x 设置或<a href="https://www.jb51.cc/tag/huoqu/" target="_blank" class="keywords">获取</a>鼠标指针位置相对于父文档的 x 像素坐标。<br> y 设置或<a href="https://www.jb51.cc/tag/huoqu/" target="_blank" class="keywords">获取</a>鼠标指针位置相对于父文档的 y 像素坐标。<br> <p>event.clientX返回事件发生时,mouse相对于客户窗口的X坐标,event.X也一样。<br><br /> 但是如果设置事件对象的定位<a href="https://www.jb51.cc/tag/shuxing/" target="_blank" class="keywords">属性</a>值为relative,event.clientX不变,而event.X返回事件对象的相对于本体的坐标。<br> </p> </p> </body> </html> </pre> @H_<a href="https://www.jb51.cc/tag/502/" target="_blank" class="keywords">502</a>_13@ <p><span style="color: #800000"><h3>18、 判断浏览器类型 </h3><h3>Js<a href="https://www.jb51.cc/tag/daima/" target="_blank" class="keywords">代码</a> </h3></p> <div class="jb51code"> <pre class="brush:js;"> <script type="text/javascript"> var Sys = {}; var ua = navigator.userAgent.toLowerCase(); var s; (s = ua.match(/msie ([\d.]+)/)) ? Sys.ie = s[1] : (s = ua.match(/firefox\/([\d.]+)/)) ? Sys.firefox = s[1] : (s = ua.match(/chrome\/([\d.]+)/)) ? Sys.chrome = s[1] : (s = ua.match(/opera.([\d.]+)/)) ? Sys.opera = s[1] : (s = ua.match(/version\/([\d.]+).*safari/)) ? Sys.safari = s[1] : 0; <p>//以下进行测试<br /> if (Sys.ie) document.write('IE: ' + Sys.ie);<br /> if (Sys.firefox) document.write('Firefox: ' + Sys.firefox);<br /> if (Sys.chrome) document.write('Chrome: ' + Sys.chrome);<br /> if (Sys.opera) document.write('Opera: ' + Sys.opera);<br /> if (Sys.safari) document.write('Safari: ' + Sys.safari); </p> </script> </pre> @H_<a href="https://www.jb51.cc/tag/502/" target="_blank" class="keywords">502</a>_13@ <p><h3>jquery版</h3> </p> <div class="jb51code"> <pre class="brush:js;"> <script src="jquery-latest.js"></script> <script type="text/javascript"> $(document).ready(function(){ var bro=$.browser; var binfo=""; if(bro.msie) {binfo="Microsoft Internet Explorer "+bro.version;} if(bro.mozilla) {binfo="Mozilla Firefox "+bro.version;} if(bro.safari) {binfo="Apple Safari "+bro.version;} if(bro.opera) {binfo="Opera "+bro.version;} alert(binfo); }) </script> </pre> @H_<a href="https://www.jb51.cc/tag/502/" target="_blank" class="keywords">502</a>_13@ <p><span style="color: #800000"><h3>19、判断是否开启cookie </h3></p> <div class="jb51code"> <pre class="brush:js;"> <script> function checkCookie() { var result=false; if(navigator.cookiesEnabled){ return true; } document.cookie = "testcookie=yes;"; <p>var setCookie = document.cookie; </p> <p>if (setCookie.indexOf("testcookie=yes") > -1){<br /> result=true;<br /> }else{<br /> document.cookie = "";<br /> } </p> <p>return result;<br /> } </p> <p>if(!checkCookie()){<br /> alert("对不起,您的浏览器的Cookie<a href="https://www.jb51.cc/tag/gongneng/" target="_blank" class="keywords">功能</a>被禁用,请开启");<br /> }else{<br /> alert("Cookie 成功开启");<br /> } </p> </script> </pre> @H_<a href="https://www.jb51.cc/tag/502/" target="_blank" class="keywords">502</a>_13@ <p><span style="color: #800000"><h3>20、 断是否开启JavaScript </h3></p> <div class="jb51code"> <pre class="brush:js;"> // 方案 1 <p><span id="js_enable">您<a href="https://www.jb51.cc/tag/guanbi/" target="_blank" class="keywords">关闭</a>了JavaScript</span><br /> <script type="text/javascript"> </p> <!-- document.getElementById("js_enable").innerHTML='您开启了JavaScript'; --> </script> <p>// 方案 2 </p> <div id="NoJs" >您禁用了javascript。@H_<a href="https://www.jb51.cc/tag/502/" target="_blank" class="keywords">502</a>_13@ <div id="YesJs" style="display:none;">您的Javascript是开启的@H_<a href="https://www.jb51.cc/tag/502/" target="_blank" class="keywords">502</a>_13@ <script> var NoJs= document.getElementById("NoJs"); var YesJs= document.getElementById("YesJs"); NoJs.style.display="none"; YesJs.style.display="block"; </script> <p>// 方案 3 </p> <p><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt</a>;<br /> <html xmlns="<a href="http://www.w3.org/1999/xhtml"&gt">http://www.w3.org/1999/xhtml"&gt</a>; </p> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>检查浏览器是否开启JavaScript@H_<a href="https://www.jb51.cc/tag/404/" target="_blank" class="keywords">404</a>_27@ </head> <body> 如果您的浏览器<a href="https://www.jb51.cc/tag/zhichi/" target="_blank" class="keywords">支持</a>的话,本<a href="https://www.jb51.cc/tag/yemian/" target="_blank" class="keywords">页面</a>什么也不会<a href="https://www.jb51.cc/tag/xianshi/" target="_blank" class="keywords">显示</a>,如果<a href="https://www.jb51.cc/tag/buzhichi/" target="_blank" class="keywords">不支持</a>,则会出现<a href="https://www.jb51.cc/tag/tishi/" target="_blank" class="keywords">提示</a>! <noscript> <body scroll=no style="text-align: center"> <center> <table border="0" style="height: 100%; width: 100%; right: 1%; left: 1%; background: black; position: fixed"> <tr> <td align="center"> <div style="position: fixed; font-size: 18px; z-index: 2; cursor: help; background: #F8F8FF; width: 480px; color: black; padding: 5px 5px 5px 5px; border: 1px solid; border-color: maroon; height: auto; text-align: left; left: 20%"> <span style="font: bold 20px Arial; color:#F8F8FF; background: maroon; vertical-align: middle">对不起,你的浏览器没有打开JavaScript脚本<a href="https://www.jb51.cc/tag/zhichi/" target="_blank" class="keywords">支持</a>!</span>@H_<a href="https://www.jb51.cc/tag/502/" target="_blank" class="keywords">502</a>_13@ </td> </tr> </table> </center> </noscript> </body> </html> </pre> @H_<a href="https://www.jb51.cc/tag/502/" target="_blank" class="keywords">502</a>_13@ <p><span style="color: #3366ff"><h3>HTML <noscript> <a href="https://www.jb51.cc/tag/biaoqian/" target="_blank" class="keywords">标签</a></h3>  定义和<a href="https://www.jb51.cc/tag/yongfa/" target="_blank" class="keywords">用法</a>   noscript 元素用来定义在脚本未被执行时的替代<a href="https://www.jb51.cc/tag/neirong/" target="_blank" class="keywords">内容</a>(文本)。    此<a href="https://www.jb51.cc/tag/biaoqian/" target="_blank" class="keywords">标签</a>可被用于可识别 <script> <a href="https://www.jb51.cc/tag/biaoqian/" target="_blank" class="keywords">标签</a>但无法<a href="https://www.jb51.cc/tag/zhichi/" target="_blank" class="keywords">支持</a>其中的脚本的浏览器。 <p>注释:如果浏览器<a href="https://www.jb51.cc/tag/zhichi/" target="_blank" class="keywords">支持</a>脚本,那么它不会<a href="https://www.jb51.cc/tag/xianshi/" target="_blank" class="keywords">显示</a>出 noscript 元素中的文本。<br />  注释:无法识别 <script> <a href="https://www.jb51.cc/tag/biaoqian/" target="_blank" class="keywords">标签</a>的浏览器会把<a href="https://www.jb51.cc/tag/biaoqian/" target="_blank" class="keywords">标签</a>的<a href="https://www.jb51.cc/tag/neirong/" target="_blank" class="keywords">内容</a><a href="https://www.jb51.cc/tag/xianshi/" target="_blank" class="keywords">显示</a>到<a href="https://www.jb51.cc/tag/yemian/" target="_blank" class="keywords">页面</a>上。为了避免浏览器这样做,您应当在注释<a href="https://www.jb51.cc/tag/biaoqian/" target="_blank" class="keywords">标签</a>中隐藏脚本。老式的(无法识别 <script> <a href="https://www.jb51.cc/tag/biaoqian/" target="_blank" class="keywords">标签</a>的)浏览器会忽略注释,这样就不会把<a href="https://www.jb51.cc/tag/biaoqian/" target="_blank" class="keywords">标签</a>的<a href="https://www.jb51.cc/tag/neirong/" target="_blank" class="keywords">内容</a>写到<a href="https://www.jb51.cc/tag/yemian/" target="_blank" class="keywords">页面</a>上,而新式的浏览器则懂得执行这些脚本,即使它们被包围在注释<a href="https://www.jb51.cc/tag/biaoqian/" target="_blank" class="keywords">标签</a>中!<br /> <span style="color: #800000"><h3>21、JavaScript 打字机<a href="https://www.jb51.cc/tag/xiaoguo/" target="_blank" class="keywords">效果</a></h3><br /> <span style="color: #3366ff"><h3>实例1</h3></p> </p> <div class="jb51code"> <pre class="brush:xhtml;"> <html> <title>JavaScript 打字机@H_<a href="https://www.jb51.cc/tag/404/" target="_blank" class="keywords">404</a>_27@ <head> <style type="text/css"> body{ font-family: Trebuchet MS,Lucida Sans Unicode,Arial,sans-serif; margin-top:0px; background-image:url('../../images/heading3.gif'); background-repeat:no-repeat; padding-top:100px; } #myContent,#myContent blink{ width:500px; height:200px; background:black; color: #00FF00; font-family:courier; } blink{ display:inline; <p>} </p> </style> <script type="text/javascript"> var charIndex = -1; var stringLength = 0; var inputText; function writeContent(init){ if(init){ inputText = document.getElementById('contentToWrite').innerHTML; } if(charIndex==-1){ charIndex = 0; stringLength = inputText.length; } var initString = document.getElementById('myContent').innerHTML; initStringinitString = initString.replace(/<SPAN.*$/gi,""); <p>var theChar = inputText.charAt(charIndex);<br /> var nextFourChars = inputText.substr(charIndex,4);<br /> if(nextFourChars=='<BR>' || nextFourChars=='<br>'){<br /> theChar = '<BR>';<br /> charIndex+=3;<br /> }<br /> initStringinitString = initString + theChar + "<SPAN id='blink'>_</SPAN>";<br /> document.getElementById('myContent').innerHTML = initString; </p> <p>charIndexcharIndex = charIndex/1 +1;<br /> if(charIndex%2==1){<br /> document.getElementById('blink').style.display='none';<br /> }else{<br /> document.getElementById('blink').style.display='inline';<br /> } </p> <p>if(charIndex<=stringLength){<br /> setTimeout('writeContent(false)',150);<br /> }else{<br /> blinkSpan();<br /> }<br /> } </p> <p>var currentStyle = 'inline';<br /> function blinkSpan(){<br /> if(currentStyle=='inline'){<br /> currentStyle='none';<br /> }else{<br /> currentStyle='inline';<br /> }<br /> document.getElementById('blink').style.display = currentStyle;<br /> setTimeout('blinkSpan()',500); </p> <p>} </p> </script> <body> <p><div id="myContent"><br /> @H_<a href="https://www.jb51.cc/tag/502/" target="_blank" class="keywords">502</a>_13@<br /> <div id="contentToWrite" style="display:none"> </p> <!-- Put the typewriter content here--> <p>sharejs.com<br /> Login : username<br><br /> password : <strong>**</strong><br><br /> Access is granted<br> </p> <!-- End typewriter content --> <p>@H_<a href="https://www.jb51.cc/tag/502/" target="_blank" class="keywords">502</a>_13@<br /> <script type="text/javascript"><br /> writeContent(true); </p> </script> </body> </html> </pre> @H_<a href="https://www.jb51.cc/tag/502/" target="_blank" class="keywords">502</a>_13@ <p><span style="color: #3366ff"><h3>实例2 (兼容IE,FX)</h3> </p> <div class="jb51code"> <pre class="brush:xhtml;"> <html> <head> <title>打字<a href="https://www.jb51.cc/tag/xiaoguo/" target="_blank" class="keywords">效果</a>的带<a href="https://www.jb51.cc/tag/lianjie/" target="_blank" class="keywords">链接</a>的新闻<a href="https://www.jb51.cc/tag/biaoti/" target="_blank" class="keywords">标题</a>@H_<a href="https://www.jb51.cc/tag/404/" target="_blank" class="keywords">404</a>_27@ <<a href="https://www.jb51.cc/tag/Meta/" target="_blank" class="keywords">Meta</a> http-equiv="Content-Type" content="text/html; charset=utf-8"> <style type="text/css"> body{font-size:14px;font-weight:bold;} </style> </head> <body> 最新<a href="https://www.jb51.cc/tag/neirong/" target="_blank" class="keywords">内容</a>:<a id="HotNews" href="" target="_blank"></a> <script language="JavaScript"> var NewsTime = 2000; //每条新闻的停留时间 var TextTime = 50; //新闻标题文字出现等待时间,越小越快 <p>var newsi = 0;<br /> var txti = 0;<br /> var txttimer;<br /> var newstimer; </p> <p>var newnewstitle = new Array(); //新闻标题<br /> var newnewshref = new Array(); //新闻链接 </p> <p>newstitle[0] = "javascript常用函数";<br /> newshref[0] = "//www.jb51.cc/article/74365.htm"; </p> <p>newstitle[1] = "//www.jb51.cc/";<br /> newshref[1] = "//www.jb51.cc/"; </p> <p>function shownew()<br /> {<br /> var endstr = "_";<br /> hwnewstr = newstitle[newsi];<br /> newslink = newshref[newsi];<br /> if(txti==(hwnewstr.length-1)){endstr="";}<br /> if(txti>=hwnewstr.length){<br /> clearInterval(txttimer);<br /> clearInterval(newstimer);<br /> newsi++;<br /> if(newsi>=newstitle.length){<br /> newsi = 0<br /> }<br /> newstimer = setInterval("shownew()",NewsTime);<br /> txti = 0;<br /> return;<br /> }<br /> clearInterval(txttimer);<br /> document.getElementById("HotNews").href=newslink;<br /> document.getElementById("HotNews").innerHTML = hwnewstr.substring(0,txti+1)+endstr;<br /> txti++;<br /> txttimer = setInterval("shownew()",TextTime);<br /> }<br /> shownew(); </p> </script> </body> </html> </pre> </div> <p><span style="color: #800000"><h3>22、简单打印 </h3></p> <div class="jb51code"> <pre class="brush:js;"> <style type="text/css" media=print> .noprint{display : none } </style> <input id="btnPrint" type="button" value="打印" onclick="javascript:window.print();" /><br> 这里是被打印的地方,这里是被打印的地方,这里是被打印的地方,这里是被打印的地方,这里是被打印的地方,<br> 这里是被打印的地方,这里是被打印的地方,这里是被打印的地方,这里是被打印的地方,这里是被打印的地方,<br> 这里是被打印的地方,这里是被打印的地方,这里是被打印的地方,这里是被打印的地方,这里是被打印的地方,<br> <p class="noprint">这里是不需要打印的地方</p> </pre> </div> <p><span style="color: #800000"><h3>23、禁止右键</h3> </p> <div class="jb51code"> <pre class="brush:xhtml;"> <html> <title>jquery 禁止右键 Xinjiang to implement amended public security measures to safeguard social stability Xinjiang to implement amended public security measures to safeguard social stability Xinjiang to implement amended public security measures to safeguard social stability Xinjiang to implement amended public security measures to safeguard social stability Xinjiang to implement amended public security measures to safeguard social stability Xinjiang to implement amended public security measures to safeguard social stability

24、防止垃圾邮件

function GRUBeoQUurKVgk(){
document.getElementById("TPNTZyRk").href= "mailto:"+syniH + nQEEGoTp;
document.getElementById("gTslyYgEq").innerHTML = syniH + nQEEGoTp;
}

JwcFoxtWH@aPpeoOw.com RPibMejAUX@NQDg.com PWlVlgKG@QCpBcER.com SxOuqrHes@mszff.com taMmRPLu@EzcI.com NfXidnW@yympz.com quuMcbaKda@aUNdsyb.com DcnXCxaR@QcrN.com QeofXl@ibCh.com OxqzDkSH@hrScW.com @H_502_13@

25、复制(javaeye flash版)

<div class="tools">
Javaeye

<embed tplayername="SWF"
splayername="SWF" id="Player1264100331386" type="application/x-shockwave-flash" src="clipboard.swf"
mediawrapchecked="true" flashvars="clipboard=<?=$clipboard?>" quality="high"
allowscriptaccess="always"
pluginspage="http://www.macromedia.com/go/getflashplayer" height="15" width="14">

@H_502_13@

@H_502_13@

@H_502_13@

26、阻止冒泡事件或阻止浏览器默认行为

function stopDefault(e) {
//阻止默认浏览器动作(W3C)
if (e && e.preventDefault)
e.preventDefault();
//IE中阻止函数器默认动作的方式
else
window.event.returnValue = false;
return false;
}

@H_502_13@

27、关闭跳转窗口时提示

退出系统?")) { return true; } return false; }

或者

@H_502_13@

28、用javascript获取地 址栏参数 //本页地址为: alert(document.location);

方法一:

var strHref = "www.cnlei.org/index.htm?a=aaa&b=bbb&c=ccc";
alert(strHref.getQuery("a"));
alert(strHref.getQuery("b"));
alert(strHref.getQuery("c"));
//-->

@H_502_13@

方法二:

@H_502_13@

方法三:

for(var i = 0; i < arrTmp.length; i++) {
var arrTemp = arrTmp[i].split("=");
if(arrTemp[0].toUpperCase() == strName.toUpperCase()) return arrTemp[1];
}
return "";
}
alert(Request("a"));
alert(Request("b"));
alert(Request("c"));
//-->

@H_502_13@

29、计算停留的时间

@H_502_13@

iframe 版

@H_502_13@

以上就是小编为大家整理的常用的javascript函数,希望对大家的学习有所帮助,还有最后一篇关于常用的javascript函数文章即将推出,继续关注。

原文链接:https://www.f2er.com/js/51856.html

猜你在找的JavaScript相关文章