<body> <script> function Submit () { var input1 = document.getElementById ("inputID"); window.open ("bb.htm?inputstr=" + input1.value);//Incoming parameters } </script> <input type = "text" id = "inputID" > <input type = "button" onclick = "submit ()" VALUE = "Submit" > </body> Bb.htm: <script> Methods of obtaining parameters var request = { Querystring:function (Val) { var uri = Window.location.search; var re = new RegExp ("+val+" = ([^&?] *) "," IG "); Return (Uri.match (re))? ( Uri.match (re) [0].substr (Val.leng th+1)): null); } } </script> <body> <script> Call method Get parameter var RT = Request. QueryString ("Inputstr"); alert (RT); </script> </body> ==================================== <title>test</title> <meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "> <script language= "JavaScript" > <!-- var request = { Querystring:function (val) { var uri = Window.location.search; var re = new RegExp ("+val+" = ([^&?] *) "," IG "); Return (Uri.match (re))? ( Uri.match (re) [0].substr (Val.leng th+1)): null); } } var a = Request. QueryString ("a"); var B = Request. QueryString ("B"); var c = Request. QueryString ("C"); if ((a!= null)) {a=a} else{a= "parameter a Null"} if ((b!= null)) {b=b} else{b= "parameter B Empty"} if ((c!= null)) {c=c} else{c= "parameter C Null"} Document.writeln ("parameter A:" + a); Document.writeln ("<br> parameter B:" + B); Document.writeln ("<br> parameter C:" + C); --> </SCRIPT> <body> <form name= "Form1" action= "?" > Please input parameter value:<br> <script language= "JavaScript" > Document.writeln ("A:<input type= ' text ' name= ' A ' value= '" "+a+" ' ><br> "); Document.writeln ("B:<input type= ' text ' name= ' B ' value= '" "+b+" ' ><br> "); Document.writeln ("C:<input type= ' text ' name= ' C ' value= '" "+c+" ' ><br> "); </SCRIPT> <input type= "Submit" name= "Submit" value= "Submission parameter view effect" > </form> </body> |