问题
I use below source code in my script.
I worked fine with Crome Browser.
but didn't work with Internet Explorer.
How can I do?
somebody help me please.
<!DOCTYPE html>
<html>
<head>
<title></title>
<script language="JavaScript">
<!--
function login() {
document.form1.action="http://website.com/login/login.asp";
document.form1.submit();
}
//-->
</script>
</head>
<body onload="login()">
<form method=post name="form1" id="form1">
<input type="hidden" name="ID_Text" value="abcd">
<input type="hidden" name="PW_Text" value="abcd">
</form>
</body>
</html>
回答1:
I am pulling the answer out of your question for future visitors.
<!DOCTYPE html>
<head>
</head>
<body>
<script type="text/javascript">
BoardURL="http://WEBSITE.COM";
UserName="abcd";
PassWord="abcd";
document.write('<form name="autoLogin" action="'+BoardURL+'/login/login.asp" method="post"><input type="hidden" name="ID_TEXT" value="'+UserName+'"><input type="hidden" name="PW_TEXT" value="'+PassWord+'">');
document.forms[0].submit();
</script>
</body>
</html>
来源:https://stackoverflow.com/questions/23213741/how-can-i-autologin-into-a-website-with-ie