<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 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");
</script>
</html>
转自
http://ben-sin.javaeye.com/blog/197469,,,作者是谁,,,,,他没写 

相关文章:

  • 2021-08-16
  • 2021-07-31
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-10
  • 2021-07-21
猜你喜欢
  • 2022-12-23
  • 2022-02-03
  • 2022-12-23
  • 2022-12-23
  • 2021-12-02
  • 2021-09-19
  • 2022-12-23
相关资源
相似解决方案