- Henry
jQuery does allow you to pass in an XMLHTTPRequest factory function when
using jQuery.ajax(). I'm not sure about the derived ajax methods, but
they would be simple enough for a user to stub with modified versions.
Tim
I was thinking about this more this morning and was actually going to suggest considering this type of model vs. trying to get the different frameworks to agree to look for a particular object in the DOM during their initialization. I think if I were on the framework side I'd be very resistant to checking for the existence of a particular object at initialization time -- it just seems too arbitrary and specific to me (what if someone else came along and had a good reason to prefer they look for some other object etc). But I think I'd be open to adding hooks to do something like what it sounds like jquery supports by passing an XHR factory function.
That would put a bit more of the burden for supporting different frameworks back on the shindig side, but that actually seems more appropriate to me. So we'd need to define one generic feature which builds the XHR wrapper over osapi.http (and it sounds like that already exists) and then we'd need to build a framework-specific feature which depended on the generic wrapper and added the required framework-specific initialization for each framework we wanted to support.
Although thinking through it a bit more... If the framework-specific initialization to override XHR was part of a one-time initialization function then we couldn't really call it from our feature since the gadget may need to specify additional initialization parameters of its own... So maybe then the framework-specific feature would just do whatever legwork was required to get as close as we can and then leave it up to the gadget developer to connect the last dots? So in the case of jquery -- maybe we could define and make available the XHR factory function but leave it to the developer to do the last bits of hooking it up (just using this as an example -- if it's possible to do all of the work ourselves without causing any problems that would of course be fine too).
>Tim
>
>
>--
>You received this message because you are subscribed to the Google Groups
>"OpenSocial and Gadgets Specification Discussion" group.
>To post to this group, send email to opensocial-and-gadgets-
>sp...@googlegroups.com.
>To unsubscribe from this group, send email to opensocial-and-gadgets-
>spec+uns...@googlegroups.com.