Example:
// Javascript parameters (multiple parameters)
Var url = "B. aspx? TxtA = "+ document. getElementById (" txtName "). value;
Url + = "& txtB =" + document. getElementById ("txtAge"). value;
Window. open (url, 'xwindow', 'width = 640, height = 400, status = no, toolbar = no, menubar = no, location = no, scrollbars = yes, resizable = no, top = 250, left = 430 ');
// Obtain the target page of B. aspx
Copy codeThe Code is as follows:
<Scirpt language = 'audio cirpt '>
<! --
Function GetStringValue ()
{
String. prototype. getQueryString = function (name) // name is the URL parameter name.
{
Var reg = new RegExp ("(^ | & | \\?) "+ Name +" = ([^ &] *) (& | $) "), r;
If (r = this. match (reg) return unescape (r [2]); return null;
};
// You can directly pass the parameter name to obtain the parameter value.
Alert (window. location. href. getQueryString ("txtA") + window. location. href. getQueryString ("txtB "));
}
-->
</Scirpt>
Differences between window. open and window. location:
Window. open is to open a new window
Window. location is to replace this page, that is, to locate
Onclick = "javascript: window. location. href = 'xxxx. aspx ';"
The JavaScript URL parameter is read from the simplified version.
Http://www.jb51.net/article/17116.htm