이후 요청이있을 때 ajax 요청이 완료되지 않는 이상한 문제가 있습니다.jQuery ajax 요청이 완료되지 않았습니다.
웹 페이지를 처음로드 할 때 ajax 호출이 올바르게 작동합니다. 그러나 페이지를 새로 고치지 않고 동일한 메소드를 호출하면 요청이 완료되지 않고 심지어 아파치도 응답하지 않습니다. 나는 아파치 오류 로그를 확인하고 다음 항목을 발견 : 브라우저가 중복 요청으로 서버를 홍수 것 같다
(function($) {
$(function(){
form = $('form.crud');
$("#end_date").datepicker({dateFormat: 'yy-mm-dd'});
/** Contract Comments **/
$('#actionbar ul li:nth-child(1) a').colorbox({
scrollable: false,
innerWidth: 600,
innerHeight: 280,
href: SITE_URL + 'admin/contracts/comments/create_ajax',
onComplete: function() {
$.colorbox.resize();
$('form#comments').removeAttr('action');
$('form#comments').live('submit', function(e) {
var form_data = $(this).serialize();
$.ajax({
url: SITE_URL + 'admin/contracts/comments/create_ajax',
type: "POST",
data: form_data,
success: function(obj) {
if(obj.status == 'ok') {
$.colorbox.close();
} else {
$('#cboxLoadedContent').html(obj.message + obj.form);
$('#cboxLoadedContent p:first').addClass('notification error').show();
}
}
});
e.preventDefault();
});
}
});
});
})(jQuery);
:
여기[Tue Nov 01 16:41:42 2011] [error] server reached MaxClients setting, consider raising the MaxClients setting
내가 실행하려고하고있는 jQuery 코드입니다. MaxClients 수를 늘리는 것이 합리적입니까 (현재 MPM을 프리 프레킹하는 경우 256, 작업자 MPM을 사용하는 경우 300)
console.log를 라이브 기능에 추가하고 다시 테스트했습니다. 내가 찾은 동작은 다음과 같습니다. 첫 번째 요청에서 모든 요청이 단일 요청으로 정상적으로 작동하고 ajax 요청을 완료 한 후 colorbox가 닫힙니다. 두 번째 요청도 완료되었지만 이번에 두 개의 요청이 서버로 전송되었습니다. 세 번째 요청은 전혀 완료되지 않았습니다. live() 메서드에 대해 더 잘 이해하고 다시 돌아와야합니다. – libregeek