// 取得网址中特定参数的值function GetUrlParameter(paramName) { var returnVal = ""; try { var paramUrl = window.location.search; //处理长度 if (paramUrl.length > 0) { paramUrl = paramUrl.substring(1, paramUrl.length); var paramUrlArray = paramUrl.split("&"); for (var i = 0; i < paramUrlArray.length; i++) { if (paramUrlArray[i].toLowerCase().indexOf(paramName.toLowerCase()) != -1) { var temp = paramUrlArray[i].split("="); if (temp[0].toLowerCase() == paramName.toLowerCase()) { returnVal = temp[1]; break; } } } } } catch (e) { } return returnVal; } //获得coolie 的值function cookie(name){ var cookieArray=document.cookie.split("; "); //得到分割的cookie名值对 var cookie=new Object(); for (var i=0;i0){ //为时不设定过期时间,浏览器关闭时cookie自动消失 var date = new Date(); var ms = objHours*3600*1000; date.setTime(date.getTime() + ms); str += "; expires=" + date.toGMTString(); } document.cookie = str;} //两个参数,一个是cookie的名子,一个是值function SetCookie(name,value){ var Days = 30; //此 cookie 将被保存 30 天 var exp = new Date(); //new Date("December 31, 9998"); exp.setTime(exp.getTime() + Days*24*60*60*1000); document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();}//取cookies函数 function getCookie(name){ var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)")); if(arr != null) return unescape(arr[2]); return null;}//删除cookiefunction delCookie(name){ var exp = new Date(); exp.setTime(exp.getTime() - 1); var cval=getCookie(name); if(cval!=null) document.cookie= name + "="+cval+";expires="+exp.toGMTString();}