美文网首页KAMS
semantic API使用

semantic API使用

作者: cobantou | 来源:发表于2016-11-29 14:27 被阅读214次

    用于表单

    Semantic 异步提交表单已经写过,这里就不赘述了

    直接调用

    $(document).api({
        on: "now",
        method: 'post',
        action: "get orgnaztion",
        onSuccess: function(data) {
            var _data = data;
            othis.renderTree(_data);
        }
    });
    
    

    将api绑定在document上,然后直接on:'now'就可以立即调用。

    公共文件

    js/common/下有一个api.js文件,里面的内容是这样的:

    Paste_Image.png

    格式:

    //分类xx
    $.extend($.fn.api.settings.api,{
        ..
    });
    

    你可以在这个里面写上你的接口,这样就可以公用了。

    相关文章

      网友评论

        本文标题:semantic API使用

        本文链接:https://www.haomeiwen.com/subject/hxgapttx.html