js 获取url参数

<!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --> function  getUrlParam(name)
{   
    
var  reg  =   new  RegExp( " (^|&) " +  name  + " =([^&]*)(&|$) " );  
    
// alert(reg); 
     var  r  =  window.location.search.substr( 1 ).match(reg);   
    
if (r != null return  unescape(r[ 2 ]);
    
return     null ;   
}

你可能感兴趣的:(url)