javascript - Ajax JSON application -


i'm able append first image in <li>. tried use prepend rather append, , shows last image only.

can me please?

$.ajax({     url:'http://localhost/php/events.php',     headers:{"content-type": "application/json"},     type:'post',     data:$(this),     datatype:'json',     error:function(jqxhr,text_status,strerror){         alert(strerror);     },     timeout:60000,     success:function(data){         for(var in data){             $("#images").append("<li>"+data[i]+"</li>");                             }        } }); 

into success callback function, this:

success:function(data){     $.each(data, function(k, v) {        $("#images").append("<li>"+ v +"</li>");                          })   } 

Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -