我有这个代码在页面加载时自动提交表单,但需要20秒才能完成页面完成加载后提交。是否有可能使body onload事件更快?
我在这里做错了什么? 如果没有,如何绕过那20秒的延迟? 我们可以使body onload事件更快吗?
代码:
<html>
<body onload="document.forms['loginform'].submit();">
<form id="loginform" name="loginform" action="https://login.url.com" method="post" style="visibility:hidden">
<input type="hidden" value="" name="hhh">
<input type="text" value="username" id="login_field" name="username">
<input type="password" value="pass" id="password_field" name="password">
<input type="hidden" value="" id="password_strength" name="password_strength">
<input type="hidden" value="/index.php" id="sendto" name="sendto">
<button id="btn_logon" type="submit"><span>Login</span></button>
</form>
</body>
</html>
太感谢你了。
当然,提交后20秒延迟*是由于服务器上的处理缓慢。 – brianpeiris 2011-04-25 03:59:37