<html> <head> <meta http-equiv="Content-Type" content="html/text; charset=utf-8"/> <title>JS get Parameter</title> <mce:script src="resource/js/param.js" mce_src="resource/js/param.js" type="text/javascript"></mce:script> </head> <body> <table> <tr> <td><input type="text" name="user" /></td> <td><input type="text" name="password" /></td> <td><input type="text" name="sysno" /></td> </tr> </table> </body> <mce:script type="text/javascript"><!-- var LocString=String(window.document.location.href); function getQueryStr(str){ var rs = new RegExp("(^|)"+str+"=([^/&]*)(/&|$)","gi").exec(LocString), tmp; if(tmp=rs){ return tmp[2]; } // parameter cannot be found return ""; } document.getElementById("user").value = getQueryStr("user"); document.getElementById("password").value = getQueryStr("password"); document.getElementById("sysno").value = getQueryStr("sysno"); // --></mce:script> </html> 自己做的的小站,喜欢网络小说、喜欢读书的朋友欢迎来转一转