#471 closed bug (fixed)
Please pass the XHR to global ajax callbacks (also add ajaxSend)
Reported by: | malsup | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | ajax | Version: | |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
The global ajax callback methods ajaxSuccess, ajaxComplete, and ajaxError need to be passed the XMLHttpRequest object so they make use of it for intelligent error messages, etc.
jQuery.event.trigger( "ajaxSuccess", [xml] ); jQuery.event.trigger( "ajaxComplete", [xml] ); jQuery.event.trigger( "ajaxError", [xml] );
In addition, there should probably be a global ajaxSend method which is invoked after the new beforeSend callback. This will allow for XHR modifications such as request headers to be handled globally.
Allow custom headers/mimetypes if( s.beforeSend )
s.beforeSend(xml);
if (s.global)
jQuery.event.trigger("ajaxSend", [xml]);
Change History (3)
comment:1 Changed 16 years ago by
comment:2 Changed 16 years ago by
I would like the settings to be passed to the event of ajaxSend so I can modify headers based on the passed setting...
jQuery.event.trigger("ajaxSend", [xml, s]);
something like that..
comment:3 Changed 16 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Fixed in SVN. ajaxSuccess, ajaxComplete, ajaxError and ajaxSend get the XMLHttpRequest and the settings passed as arguments.
Oops. Darn formatting..