XHR

联合创作 · 2023-10-02 15:20

This tiny plugin provides a registry for different xhr implementations to co-exist.
It requires jQuery 1.3/1.2.7 with its new feature, the 'xhr' ajax setting.

If you want to provide a new implementation, you need to do this:

jQuery.xhr.register( 'my_xhr', function( settings ){
    return new MyXhrImplementation( settings );
});

The argument settings is the settings object used by jQuery.ajax.

To use it, you do:

$.ajax({
    url:'...',
    transport:'my_xhr',
    // ...
});

The default implementation is used by default (unless it's overriden with ajaxSetup) and it's called 'xhr'.

浏览 18
点赞
评论
收藏
分享

手机扫一扫分享

编辑 分享
举报
评论
图片
表情
推荐
点赞
评论
收藏
分享

手机扫一扫分享

编辑 分享
举报