I'm still a newbie with jQuery, as such, I'm still catching up with
terminologies and the jQuery "language"

Exploring the ajaxComplete() event handler,  it seems to me that the
prototype description of its callback function parameters are reverse?

For example, the docs for  ajaxComplete( callback ) says:

   Attach a function to be executed whenever an AJAX
   request completes. The XMLHttpRequest and settings
   used for that request are passed as arguments to the callback.

with the example:

   $("#msg").ajaxComplete(function(request, settings){
      $(this).append("<li>Request Complete.</li>");
   });

well, for my test, under the FireBug Debugger I stepped into this
callback and it says request is type "Object" and settings is type
"XMLHttpRequest"

Is this an example type, the parameters should be (settings, request)
or I am not understanding?

I'm sure I am understanding, but when I modified the example for my
testing of using $.getJSON(), like so:

JSON: <div id="JsonDump"></div>

<script type='text/javascript'>
$(document).ready(function() {
  var url = "/code/jSystemMonitor.wcx";
  var secs = 5000;
  $("#JsonDump").ajaxComplete(function(request, settings){
    $(this).append("<li>"+settings.responseText+"</li>");
  });
  var res = $.getJSON(url);
  setInterval( function() { var res = $.getJSON(url); }, secs);
});
</script>

I naturally thought and used request.responseText instead of
settings.responseText first before seeing it this was wrong. Maybe the
parameter name "setting" is not appropiate.  I used to libraries where
function prototyping  descriptions convery ideas like  Hungarian
notations or similar ideas that allow to quickly understand the
parameters types with a visual reading only:  I had to dig into the
jQuery.js source to see what exactly was being passed and even then it
wasn't clear.

Overall,  is there a documented summary showing the function prototype
definitions for all various jQuery methods that offer callbacks?

Reply via email to