论坛首页 Web前端技术论坛

dojo get post demo

浏览 980 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2015-07-31  

 

 

dojo.xhrGet({
        url: "../api/category.do",
        handleAs: "json",
        load: function(response) {
            console.log("category.do result:"+response);
        },
        error: function() {
            alert("error")
        }
    });

dojo.xhrPost({
    url: "../api/toppattern.do",
    handleAs: "json",
    postData:dojo.toJson(json),
    contentType : 'application/json; charset=utf-8',
    load: function(data) {
        console.log("toppattern.do request:"+JSON.stringify(json));
        console.log("toppattern.do response:"+JSON.stringify(data));

    },
    error: function() {
        alert("error")
    }
});



 $.ajax({
     url:"../api/patterndetails.do",
            type:"POST",
            data:JSON.stringify(jsonFix),
            contentType:"application/json; charset=utf-8",
            dataType:"json"
          }).done(function(data2) {
              console.log("patterndetails.do direct result:"+JSON.stringify(data2));
          });

 

 

 

 

 

论坛首页 Web前端技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics