php - href javascript function call -
I am trying to call a function at href, but it does not show undefined function, but this function works by itself The loop is doing when I call it inside the album. Is there any other way of calling the ARP after adding the function? I tried to use jquery onclick with anchor id, but it does not work either and no errors are found. Any ideas how should I be called?
> Photos.data) .each (function (index, value) {console.log (value.source);});}); } FB.API ('/ m / album', {limit: 5000, field: 'id, name, count, cover_photo, link'}, function (m_y album) {$ (me_album.data) .each (function (index , Value) {FBPI ('/' + value.id + '/ image', {range: 5000}, function (image) {$ ('# facebook-cover'). Attachment ('& lt; li id = "'+ Value.id +'" & gt; & lt; a href = "javascript: getPhotosByAlbumID ('+ value.id +');" id = "album" & gt; & lt; img src = "'+ Image. data.url +'" / & gt; & lt; / a & gt; & lt; / li & gt; ';);});});});
Error: Unfair ReferencesAir: getPhotosByAlbumID is not defined
All such are epidemic.
Try
var li = $ ( '& Lt; li id = "' + value.id + '" & gt; & lt; / li & gt;'); Var anchor = $ ('& lt; a href = "#" id = "album"> ;); Anchor.click (function () {getphotoByAlbumID (value.id); returned;}); Var img = $ ('& lt; img src = "' + picture.data.url + '" / "gt;'); anchor.append (img); li.append (anchor); Your click event should work in this way, unless there is no error within getPhotosByAlbumID (); You can also return false to the same function
Comments
Post a Comment