tags:

views:

149

answers:

2

In jQuery ajax function there is xhr option. Does someone know more details, usability or sample usage of this option?

A: 

http://api.jquery.com/ is your friend. From that site when you search for the ajax() command:

xhr (Function): Callback for creating the XMLHttpRequest object. Defaults to the ActiveXObject when available (IE), the XMLHttpRequest otherwise. Override to provide your own implementation for XMLHttpRequest or enhancements to the factory.It's not available in jQuery 1.2.6 and in any early version.

Generally, unless you know what you're doing you really won't be using this function of the $.ajax() function

Bartek
+1  A: 

In fact, someone does know.

The xhr option allows you to define your own callback for creating the XMLHttpRequest object that will be used behind the scenes in the ajax() call. In pretty much every single case, you shouldn't need to specify this option.

Matt Ball
Yes, it doesnt look much useful.
Vaclav Kohout
When in doubt, go to the API first.
Matt Ball