Ajax 요청 디버깅하기#

http://ajaxian.com/archives/2005/12/debugging_ajax.html

Ajax.Responders.register({
  onCreate: function() {
    if (Ajax.activeRequestCount > 0)
      Element.show('spinner');
  },
  onComplete: function() {
    if (Ajax.activeRequestCount == 0)
      Element.hide('spinner');
  }
});

다음처럼 작성해서 디버깅

Ajax.Responders.register({
  // log the beginning of the requests
  onCreate: function(request, transport) {
    new Insertion.Bottom('debug', '

[' + new Date().toString() '] accessing ' + request.url + '
')
  },

  // log the completion of the requests
  onComplete: function(request, transport) {
    new Insertion.Bottom('debug', 
    '

http status: ' + transport.status + '
' + '


    + transport.responseText.escapeHTML() '

')
  }
});

Add new attachment

Only authorized users are allowed to upload new attachments.
« This page (revision-1) was last changed on 06-Apr-2006 09:45 by 이동국