0
I 양식을 제출하고, 서버의 응답 자체를 대체하는 다음과 같은 코드가 있습니다 :jQuery를 아약스 제출 내부 파이어 폭스에서 작동하지() 살 만
$("form.replaceWithResponse").live("submit", function() {
event.preventDefault(); // not preventing default form submission in Firefox
var $this = $(this);
$.ajax({
data: $this.serialize(),
dataType: "html",
type: $this.attr("method"),
url: $this.attr("action"),
success: function(html) {
$this.replaceWith(html);
}
});
});
그것은 크롬에서 작동하지만이 작동하지 않습니다 파이어 폭스에서는 처음에 event.preventDefault()
대신에 return false
을 사용하지 않으면됩니다. 왜?
감사합니다.
나는 질문에 오타가있을 수 있다고 생각하지만, 저를 확인하기 위해 재 시도 할 수 있습니다. –