Do a show page these days. So the simplest way to do that. Not much to say on the code
and other labels ">,
Database. And check it out backstage. Because the framework is used, background code does not want to refer to it.
Control layer
@RequestMapping (params = "method=gettborgyh") public
Modelandview Gettborgyh (httpservletrequest req) {
Newmenu newmenu = new Newmenu (Requestutil.getmap (req));
return new Modelandview ("Jsonview", Newmenu.gettborgyh ());
}
The front desk made a judgment
$.ajax ({
url:sys_ctx+ '/newmenu/default.do?method=gettborgyh ',
success:function (JSON) {for
(var i=0;i <json.tm.length;i++) {
var ul = document.getElementById ("Ul1");
var li = document.createelement ("li");
var a = document.createelement ("a");
var em = document.createelement ("em");
var img = document.createelement ("img");
var tempstr =json.tm[i].tb;
if (Tempstr.length > 3) {
var ss = Tempstr.slice ( -3);
if (ss = = "PNG" | | ss = = "JPG" | | ss = = "gif") {
a.innerhtml = Json.tm[i].xstb;
A.href = Json.tm[i].url;
IMG.SRC =JSON.TM[I].TB;
Ul.appendchild (LI);
Li.appendchild (a);
A.appendchild (EM);
Em.appendchild (IMG);
}
} else {
a.innerhtml = Json.tm[i].xstb;
a.href= Json.tm[i].url;
em.innerhtml = JSON.TM[I].TB;
Ul.appendchild (LI);
Li.appendchild (a);
A.appendchild (EM);
}
}
All right