Example:
JavaScript pass parameters (multiple)
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 ');
B.aspx target page Get
Copy Code code as follows:
<scirpt language= ' javascirpt ' >
<!--
function GetStringValue ()
{
String.prototype.getQueryString = function (name)//name is the parameter name of the URL
{
var reg = new RegExp (^|&|\\?) + name + "= ([^&]*) (&|$)"), R;
if (R=this.match (reg)) return unescape (r[2]); return null;
};
The value of the parameter can be obtained directly by passing the parameter name
Alert (window.location.href.getQueryString ("Txta") +window.location.href.getquerystring ("TXTB"));
}
-->
</scirpt>
window.open and Window.location differences:
Window.Open is to open a new window
Window.location is to replace this page, that is, positioning
onclick= "javascript:window.location.href= ' xxxx.aspx ';"
JavaScript URL parameter read improved version
Http://www.jb51.net/article/17116.htm