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
CopyCode The 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