Piotr said:
Ok, all over the internet people are creating "wrapper" object over
XMLHttpRequest rather then prototyping it and I wonder why,
are there any drawbacks for this method?
Good question!
The object does not expose a public `prototype' property in all
implementations. It does in the Gecko DOM, Apple WebCore and the Opera
(9.x) DOM. It does not in the MSHTML DOM.
Also note that there was no public XHR constructor in MSHTML before version
7, you have to create the XHR object with ActiveXObject() there.
So prototyping XHR has the obvious drawback that it does not work everywhere
where XHR is supported, especially not in the reference implementation of
MSHTML. And there is no point in doing something different for another UA
when you can write your own interface and have it consistent among UAs.
Other than that, I don't buy the arguments made around here; an XHR object
that could be prototyped would not be a bad idea; probably that is what the
other implementors thought.
HTH
PointedEars