码迷,mamicode.com
首页 > Windows程序 > 详细

window.location.search

时间:2015-07-21 14:17:30      阅读:198      评论:0      收藏:0      [点我收藏+]

标签:

作用:取得【http://111111?A=1&B=2&C=3....】红色部分

上代码,起个名字:123.html

 

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="utf-8">
</head>
<body>		
<script language="javascript">
	alert(window.location.search.substr(1).split("&"));
	alert(window.location.search.split(‘&‘).join(‘|‘));
</script>
</body>
</html>

 

然后访问:。。。。123.html?topic=1&id=2

效果:

技术分享技术分享

 

window.location.search

标签:

原文地址:http://www.cnblogs.com/wang-s/p/4664030.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!