日期:2014-05-16 浏览次数:20486 次
<html> <head> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /> <title>login</title> <script type="text/javascript"> function login(){ var obj1 = document.getElementById("username"); var userStr = obj1.value; var obj2 = passwordStr = document.getElementById("password"); var passwordStr = obj2.value; var url = "http://localhost:8080/KnowledgeBase/index.html#user="+userStr+"&password="+passwordStr; [color=#FF0000]location.href = encodeURIComponent(url);[/color] } </script> </head> <body> <form> <p> <label for="username"></label> <input type="text" id="username" name="username"> </p> <p> <label for="password"></label> <input type="text" id="password" name="password"> </p> <p> <INPUT type="button" value="登陆" onClick="login()"> </p> </form> </body> </html>