现在的位置: 首页 > 综合 > 正文

javascript伪GUID,querystring

2012年10月20日 ⁄ 综合 ⁄ 共 394字 ⁄ 字号 评论关闭
代码
 function GUID() 
    {
       
return (S4()+S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+S4()+S4());
    }
    
function S4() 
    {
       
return (((1+Math.random())*0x10000)|0).toString(16).substring(1);
    }

处理querystring

 

Request = {
QueryString : 
function(item){
var svalue = window.parent.location.search.match(new RegExp("[\?\&]" + item + "=([^\&]*)(\&?)","i"));
return svalue ? svalue[1] : svalue;
}
}

 

抱歉!评论已关闭.