Dynamic generation under IE
  • and other labels
  • Source: Internet
    Author: User
    Tags json

    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

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.