0

Just wondering if the global ajax success within jQuery, get executed even if I call XMLHttpRequest manually or from within another client side framework?

Like I'm wondering if jQuery proxies the XMLHttpRequest object so that it can tap into any XMLHttpRequest call...

vdh_ant
  • 12,720
  • 13
  • 66
  • 86

1 Answers1

0

No, jQuery does not hijack the browser's default implementation of XMLHttpRequest. That's not the jQuery style of doing things. jQuery's philosophy is to leave the native objects untouched,* augment functionality using, amongst others, the Decorator pattern.

By nature XMLHttpRequest must be implemented in native code, not JavaScript, so it wouldn't be easy to hijack - and there really wouldn't be any benefit, as far as the jQuery designers might be interested.


*as compared to, say, Prototype, which modifies many DOM prototypes to achieve similar end results to jQuery.

Community
  • 1
  • 1
Matt Ball
  • 354,903
  • 100
  • 647
  • 710