我只是想获取已提交表单的操作链接,但单击未定义的提交警报
$(document).on("submit","form",function(e){
e.preventDefault();
if($(this).children("input[type=submit]").hasClass("load") && $(this).children("input[type=submit]").hasClass("last-button"))
{
setTimeout(function(){
alert($(this).attr("action"));
// $.post($(this).attr('action') , $(this).serialize() , function(data){
// $(".wholepage").html(data);
// });
},400);
}
});
HTML
<div class="well login">
<form id="reg" action="parts/background/regProcess.php" method="post">
<input placeholder="Choose an username" type="text" name="user"><br/><br/>
<input placeholder="Choose a password" type="password" name="pass1"><br/><br/>
<input placeholder="Input the password again" type="password" name="pass2"><br/><br/>
<input placeholder="Enter your E-mail address" type="text" name="email"><br/>
<input type="submit" class="last-button load" value="SUBMIT">
</form>
</div>