欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

js ajax调用rest接口

程序员文章站 2024-03-25 16:58:58
...
var _init = function(){
        $.ajax({
            url :ip:port/restname,
            dataType :'json',
//          type : "POST",
            async : false,
            success : function(result) {
                if (result["code"] === 200){

                }else {
                    Messager.alert({
                          Msg: result["msg"],
                          iconImg: "warning",
                          isModal: false
                     });
                }
            }
        });
    };
相关标签: ajax rest json