dojo中的xhrPost请求(JSON)

dojo中的xhrPost请求


dojo.xhrPost({

       url:"../area.action",

       content:{

             areaCode:areaCode

       },

       handleAs:'json',

       handle:function(resp){

              console.info(resp.items);

              //返回成功处理

      }

});


说明:(1)url:请求路径,可以是action或者json

          (2)content:传参数,前者是Java传参数,后者是页面参数

          (3)handleAs:请求方式

          (4)handle:成功返回结果后处理情况