layer彈窗與ajaxSubmit的使用
阿新 • • 發佈:2019-02-09
-
<script type="text/javascript">
$(function(){
$("#loginBtn").click(function() {
$("#register-form").ajaxSubmit({
clearForm: false,
dataType: "JSON",
success: function(responseText, statusText) {
if (statusText == "success") {
if (responseText.result == 1) {
parent.window.location.href=responseText.retUrl
var index = parent.layer.getFrameIndex(window.name); //先得到當前iframe層的索引
parent.layer.close(index)
}
}
},
error: function()
}
});
});
})
</script>