jsonp代码格式转换
来源:互联网 发布:js 字符串转时间戳 编辑:程序博客网 时间:2024/06/09 00:46
@RequestMapping(value="/pagealltype",method={RequestMethod.GET,RequestMethod.POST})
public void pagealltype(HttpServletRequest request,HttpServletResponse response) throws IOException{
String callback =request.getParameter("callback");
JSONObject list=feijiebudu_booktypeinter.pagealltype();
String retStr =callback + "(" + list + ")"; //解决问题方法
response.setCharacterEncoding("UTF-8");
response.getWriter().print(retStr);
//String messageContent = new String(request.getParameter("messageContent").getBytes("iso-8859-1"),"utf-8");
public void pagealltype(HttpServletRequest request,HttpServletResponse response) throws IOException{
String callback =request.getParameter("callback");
JSONObject list=feijiebudu_booktypeinter.pagealltype();
String retStr =callback + "(" + list + ")"; //解决问题方法
response.setCharacterEncoding("UTF-8");
response.getWriter().print(retStr);
//String messageContent = new String(request.getParameter("messageContent").getBytes("iso-8859-1"),"utf-8");
}
$(function() {
$(".swiper-container3").click(function() {
console.log("我点击了图书");
});
$(".swiper-container2 .title").click(function() {
console.log($(this).html());
});
$.ajax({
type: "post",
url: "http://192.168.1.250:8080/controller/pagehome/pagealltype",
dataType: "jsonp",
jsonp: "callback",
scriptCharset: 'utf-8',
success: function(data) {
console.log(data.rows);
console.log("请求成功");
$.each(eval(data.rows),function(i,text){
console.log(text.booktypeName);
})
}
});
})
可以访问这个博客查看详解 http://blog.csdn.net/maoxiao1229/article/details/7255441?locationNum=1&fps=1
0 0
- jsonp代码格式转换
- 将json转换为jsonp格式
- jsonp代码
- 代码实现转换[sql2000VSDBF格式]
- CSS代码格式转换工具
- 图片转换格式的代码
- Linux代码格式转换--indent
- vs2015字符格式转换代码
- 什么是jsonp格式
- jsonp基本格式
- JS解析JSONP格式
- jsonp 输写格式
- jsonp格式错误ajax
- PHP 中jsonp格式
- responseBody返回jsonp格式
- 浅析json与jsonp区别及通过ajax获得json数据后格式的转换
- 字符串转换成人民币格式代码
- android 常用时间格式转换代码
- Spring controller、service的单例模式
- 通用mapper和mybatis-spring的关系以及与之相似的spring-data-jpa
- dispose();不是ActionListener的方法
- Spring事务异常回滚,捕获异常不抛出就不会回滚
- springmvc的一个跳转特性
- jsonp代码格式转换
- mybatis 模糊查询与函数连用%需不需要拼接问题
- iOS沙盒机制原理
- SpringMVC 通过get请求实现文件上传
- mybatis的管理映射
- java字段修饰符
- java 实现搜索附近人功能
- js插件
- Nature:深度学习的现在和未来:DeepLearning、无监督学习、NLP