本文共 632 字,大约阅读时间需要 2 分钟。
<script> window.onload = login; function login(){ document.getElementById("username").value = '<?php echo $_COOKIE["username"]; ?>'; document.getElementById("password").value = '<?php echo $_COOKIE["password"]; ?>'; document.getElementById("loginForm").submit(); }</script>
<form id="loginForm" action="index.php?user-login" method="post" > <input id="username" type="text" /> <input id="password" type="password" /> <input name="submit" type="submit" value="登录"/></form>
=======================================
JS 方法中的 submit() 不执行 页面没有跳转。
在群里 网友 帮我解答了。 很感谢。
<input name="submit" ,按钮的名字不要取成关键字你调用submit()的时候,JS不会执行,因为有的名字叫submit
转载地址:https://blog.csdn.net/id19870510/article/details/5299137 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!