arrays - jQuery html not working as expected -


i'm trying insert new li img element inside ul based on array, i'm doing this, first item in array being inserted

$.getjson('/test-url/123').done (data) ->   $.each data, (index, value) ->     $('.col ul').html('<li><img src=' + value['m'] + '><li>') 

try this:

$.getjson('/test-url/123').done (data) ->   $.each data, (index, value) ->     $('.col ul').append('<li><img src=' + value['m'] + '><li>') 

Comments

Popular posts from this blog

css - I want to align grid in center -

Contact Form PHP Email Script -

python - SWIG function not printing output -