ajax后台套用两层JSONOBJECT返回到前台的方法
来源:互联网 发布:写作起名软件 编辑:程序博客网 时间:2024/05/22 00:13
前台JSP部分代码
$.ajax({ type : "post", url : "loadScene.do", data : $("#sceneForm").serialize(), async : true, dataType : "json", success : function(data) { //alert("data" + data); var scene_x = data.scene.x; var scene_y = data.scene.y; //好像没用 var scene_w = data.scene.width;//场景宽度 var scene_h = data.scene.height;//场景高度 var screen_w = screen.width; //电脑屏幕宽度 var screen_h = screen.height; //电脑屏幕高度}
后台servlet代码
JSONObject jo1 = new JSONObject();JSONObject jo2 = new JSONObject();List<String> data = new ArrayList<String>();data.add("100");data.add("100");data.add("10000");data.add("10000");data.add("a");data.add("name");data.add("view");jo1.put("x", data.get(0));jo1.put("y", data.get(1));jo1.put("width", data.get(2));jo1.put("height", data.get(3));jo1.put("stage", data.get(4));jo1.put("name", data.get(5));jo2.put("scene", jo1);PrintWriter out = response.getWriter();out.println(jo2);out.flush();out.close();
阅读全文
1 0
- ajax后台套用两层JSONOBJECT返回到前台的方法
- 后台返回前台list,前台ajax接收后遍历的方法
- ajax请求后台返回json的两种处理方法
- ajax从后台返回list类型到前台解析
- ajax发送请求后台处理数据格式然后返回前台的方法(ObjectMapper)
- aspx后台传递Json到前台的两种接收方法
- ajax json 前台传数据到后台,后台接收并返回json 数据
- ajax后台调用前台方法
- 利用ajax实现前台javascript同c#后台MVC下的controller层传递数据的方法
- 前台Ajax得到后台返回数据
- js ajax 前台到后台中文乱码的解决方法
- 利用ajax实现前台javascript同c#后台MVC下的aspx.cs文件传递数据的两种方法
- ASP.NET前台AJAX方法调用后台的方法写法
- Ajax前台返回JSON数据后再Controller中直接转换成类型使用,后台接收json转成实体的方法
- 前台js如何调用后台的方法的返回值
- .Net后台调用前台js的两种方法
- 将后台List对象以Json格式返回到前台Ajax请求
- AJAX - 前台传JSON到后台
- linux centos修改ssh端口号
- Java 获取系统中可用字体的名字
- 数据集(人数统计、密度分析)
- 存储
- 动态生成input绑定事件无效如:blur
- ajax后台套用两层JSONOBJECT返回到前台的方法
- cfRound425B. Petya and Exam
- uva227 puzzle
- 图片边角形
- HDU1201-18岁生日
- DATAKIT.CrossManager.2017.1.Win32_64 2CD
- 2017多校1 b hdu 6034
- C/S、B/S架构的区别
- jQuery 选择器 first-child和first-of-type、 last-child和last-of-type的区别