Skip to content
fkei edited this page Dec 20, 2013 · 1 revision

Summary

beez.manager.modelから、Backbone.syncを使わずに直接jQuery/ZeptoでAjax通信することが可能です。

Usage

$.ajax#get を直接実行します。

m.$get({
    url: '/ping',
    beforeSend: function (xhr, settings) {},
    success: function (data, status, xhr) {},
    error: function (xhr, type, error) {},
    complete: function (xhr, status) {}
});

他に$post, $put, $delete, $patchも用意されています。

拡張設定

urlの先頭にhttp:// or https:// がない場合は、beez.config.url.api に設定された値を自動で追加します。

Backbone.sync#emulateHTTP/emulateJSON ... といった機能も合わせて実装されています。

Backbone.$を直接利用しています。jQuery.ajax , zepto.ajax を合わせて参照ください。

Clone this wiki locally