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

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

android - IBM Worklight 6.1 [Application Error] There was a network error (file:///android_asset/www/index.html) -