Some parameters in the Web project are usually stitching behind the URL, in the JSP has Request.getparameter ("key") to obtain, in JS can also be obtained.
The content is simple to paste the example, (Ps:map this JS function in the previous blog has introduced)
Page to jump:
<?xml version= "1.0" encoding= "UTF-8"?>
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 "/>
<title>redirect</title>
<body>
<a href= "search.html?name=akwolf&age=22" >to a new page</a>
</body>
Target page, the page to receive the parameter:
<?xml version= "1.0" encoding= "UTF-8"?>
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 "/>
<script type= "Text/javascript" src= ". /jslib/jquery-1.5.min.js "></script>
<script type= "Text/javascript" src= ". /jslib/map.js "></script>
<script type= "Text/javascript" >
var map = new map ();
$ (function () {
var info = $ ("#info");
var param = Window.location.search;
param = param.substring (1);
params = Param.split ("&");
$.each (Params,function () {
var curr = this;
var m = this.split ("=");
Map.put (m[0],m[1]);
}) ;
}) ;
function ShowMsg () {
Alert (map.tostring ());
This article links http://www.cxybl.com/html/wyzz/JavaScript_Ajax/20121101/33500.html
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.