<HTML>
<Head>
<Meta http-equiv = "Content-Type" content = "html/text; charset = UTF-8"/>
<Title> JS get parameter </title>
<SCRIPT src = "resource/JS/Param. js" type = "text/JavaScript"> </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>
<SCRIPT type = "text/JavaScript">
VaR locstringinclustring({{doc ument. Location. href );
Function getquerystr (STR ){
VaR rs = new Regexp ("(^ |)" + STR + "= ([^ \ &] *) (\ & | $ )", "Gi" cmd.exe C (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 ");
</SCRIPT>
</Html>
Transferred from http://ben-sin.javaeye.com/blog/197469,,who is the author, ,,he did not write