@RequestMapping(value="/ceshijson",produces="application/json;charset=UTF-8")
@ResponseBody
public String ceshijson(@RequestBody String channelId) throws IOException{
return channelId;
function channel(){
//先获取选中的值
var channelId = $("#channelId option:selected").val();
//来判断发送的链接
if(channelId ==2){
$.ajax({
url:"ceshijson",
type:"post",
dataType:'json',
contentType:'application/json;charset=utf-8',
data:JSON.stringify({'channelId':channelId}),
success:function(data){
alert(data.channelId);
},
error:function(XMLHttpRequest, textStatus, errorThrown){
alert("Error")
alert(XMLHttpRequest.status);
alert(XMLHttpRequest.readyState);
alert(textStatus);
}
});
}
}
data:'{"channelId":'+channelId+'}'
data:"{'channelId':"+channelId+"}"
@RequestMapping(value="/ceshijson",produces="application/json;charset=UTF-8")
@ResponseBody
public String ceshijson(String channelId) throws IOException{
Map<String,Object> map = new HashMap<String,Object>();
map.put("channelId", channelId);
ObjectMapper mapper = new ObjectMapper();
channelId = mapper.writeValueAsString(map);
return channelId;
}
$.ajax({
url:"ceshijson",
type:"post",
dataType:'json',
//contentType:'application/json;charset=utf-8',
data:"channelId="+channelId,
success:function(data){
alert(data);
},
error:function(XMLHttpRequest, textStatus, errorThrown){
alert("Error")
alert(XMLHttpRequest.status);
alert(XMLHttpRequest.readyState);
alert(textStatus);
}
});
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有