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

python 3 IndexError: list index out of range -

android - How to save instance state of selected radiobutton on menu -

IF statement in MySQL trigger -