【发布时间】:2013-08-27 03:08:16
【问题描述】:
这是我的代码:
HTML
<form id="loginForm">
Username:
<input type="text" id="username" name="username" value="<?php echo $submitted_username; ?>" />
<br />
Password:
<input type="password" id="password" name="password" value="" onkeypress="onEnterLogin(event);" />
<br />
<input type="button" id="loginButton" onclick="updateLogin();" value="Login">
</form>
<a href="register.php">Register</a>
jQuery
function updateLogin() {
$.post("login.php",
$("#loginForm").serialize(),
function(html) {
$("#north").html(html);
}
);
}
有没有更好的方法来做到这一点?
$("#loginForm").serialize(),
【问题讨论】:
-
这有什么问题?
$.serialize正是您所需要的。如果您想要安全的东西,请使用https:// -
嗯,你为什么认为
serialize()不安全? -
$.serialize使用与普通表单提交相同的编码。你认为你还需要什么? -
如果您想要安全,请使用 HTTPS。
-
那么如何让它使用 HTTPS?