remember-forget

js代码

$.ajax({ 
         async:false, 
            url: \'https://***/api/prepareApi.getDanMu?sqlMapId=findBarrage\',  // 跨域URL
            type: \'get\', 
            dataType: \'jsonp\', 
            jsonp: \'jsoncallback\', //默认callback
            jsonpCallback: \'handleResponse\', //设置回调函数名
            //data: mydata, 
            timeout: 5000,
            success: function(data){
              }
            
            
      }});

 

后台代码 (返回时 转json格式,括在js自定义回掉函数名里)

@RequestMapping("api/prepareApi.getDanMu")
    public String getDanMu() throws Exception {
        Map<String, Object> map = getParameterMap();
        System.out.println("api/prepareApi.getUserUploadWeiKeTeachApi: " + map);
        
        map.put("sqlMapId", map.get("sqlMapId").toString());
        
        List<Map<String, Object>> list = openDap.queryForList(map);
        
        return "handleResponse(" +  JSONArray.parseArray(JSON.toJSONString(list)) + ")";
    }

 

分类:

技术点:

相关文章:

  • 2021-11-29
  • 2021-11-05
  • 2021-11-05
  • 2021-11-29
  • 2021-10-15
  • 2021-11-05
猜你喜欢
  • 2021-11-05
  • 2021-11-05
  • 2021-11-15
  • 2021-11-05
  • 2021-11-17
  • 2021-11-05
相关资源
相似解决方案