dojo.xhrGet({
		url: "/dojoHttpServlet?service=jsp_showPerms",
		handleAs: "json",
		load: function(data) {
			if(data==null){
				console.log("空返回值");
				return ;
			}
			var table = "<table border=\"1\" id=\"perm_table\">";
			table += "<tr><th>权限ID</th><th>权限名</th></tr>";
			dojo.forEach(data.rows, function(perm) {
				console.log(perm);
				table += "<tr><td>";
				table += perm.pid;
				table += "</td><td>";
				table += perm.name;
				table += "</td></tr>";
			});
			table += "</table>";
			dojo.place(table, dojo.body());
		}
	});

  

 

从jsp servlet获取json格式数据,并形成表格的一种做法。

相关文章:

  • 2021-09-09
  • 2022-01-26
  • 2021-11-02
  • 2021-12-13
  • 2022-12-23
猜你喜欢
  • 2022-01-09
  • 2021-06-03
  • 2021-06-01
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案