1. Pass parameters:

var PMT='sensor=' + encodeURI (encodeURI (sensor)) + '&device=' + encodeURI (encodeURI (device)) + '&instrument=';
PMT +=encodeURI (encodeURI (instrument)) + '&n=' + n + '&addDate=' + addDate;
top. Location. Href='http://www.script-home.com//article/jsp/print/diagnosticAnaPrint.jsp? '+ PMT;

2. Receive and parse parameter

//
access to the URL parameter function GetRequest () {
var URL=location. The search;//get the url "?" Following the string
var theRequest=new Object ();
if (url. IndexOf ("? ")!=1) {
var STR=url. The substr (1);
STRS=STR. The split (" &");
the for (var I=0; I <STRS. Length; I + +) {
theRequest [STRS [I] the split ("=") [0]]=unescape (STRS [I] the split ("=") [1]).

}}
return theRequest;
}

var sensor;//point
sensor=decodeURI (decodeURI (Request [' sensor '])); Reference content:
3.
method one: regular analysis

function getQueryString (name) {
var reg=new RegExp (" (^ | &) "+ name +"=(/^ &*) (&| $) "and" I ");
var r=window. The location. The search. The substr (1) the match (reg);
if (r!=null) return unescape (r) [2]; Return null;

} call like this:
alert (GetQueryString (parameter name "1")); Parameter name
alert (GetQueryString (" 2 ")); Parameter name
alert (GetQueryString (" 3 "));

method 2:

<Span style="font - size: 16px;" ><Script language="javascript" >
function GetRequest () {
var url=location. The search;//get the url "?" Following the string
var theRequest=new Object ();
if (url. IndexOf ("? ")!=1) {
var STR=url. The substr (1);
STRS=STR. The split (" &");
the for (var I=0; I <STRS. Length; I + +) {
theRequest [STRS [I] the split ("=") [0]]=unescape (STRS [I] the split ("=") [1]).

}}
return theRequest;

} </script> </span>
this invocation:  
<Script language="javascript" >
var Request=new Object ();
Request=GetRequest ();
var parameters 1, 2, and 3 parameters, parameter N. 1=
parameter Request [' parameter 1];
2=Request parameters (parameters' 2 '), 3=
parameter Request [' parameter 3];
parameter N=Request [' parameter N];
</script>

you might be interested in the article:


This concludes the body part