日期:2014-05-16  浏览次数:20431 次

js获得url中的参数信息

http://www.blogjava.net/bainian/articles/185657.html
/**/ /*
获取URL中最后一项参数的值
*/


var ?str = window.location.href;
// alert(str);
var ?es =/ SouceID =/ ;?
es.exec(str);?
var ?right = RegExp.rightContext;?
// alert(right);
???
? //列子
????<script language="javascript">?
????var str=window.location.href;?
????var es=/SouceID=/;?
????es.exec(str);?
????var right=RegExp.rightContext;?
????//alert(right);
????switch(right){
????case 'Din':
????case 'Exh':
????case 'Banks':
????case 'Shop':
????case 'Treat':
????case 'Trip':
?????????ChgTab('tab3','tabcontent3');
?????????break;
????case 'Air':
????case 'Railway':
????case 'Road':
????case 'Subway':
??????????ChgTab('tab2','tabcontent2');
??????????break;
???default:
?????????ChgTab('tab1','tabcontent1');
}
</script>


// 以下是函数的写法
function ?GetParam() {
????
v