dojo get post demo

 

 

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));
          });

 

 

 

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章