I have the following code which displays the file name of images in asearch results page. It works, but doen't output the last image file name. This happens on any length of search results.
$(".picture img").each(function () { var caption = $(this).attr('src').replace(/.jpg/, '').split('/').pop(); $(this).parent().next().text(caption);});
.each issue - not displaying last element
in JavaScript
Posted · Edited by ebsolutions
Hi,
I have the following code which displays the file name of images in asearch results page. It works, but doen't output the last image file name. This happens on any length of search results.
Any ideas what would cause this to happen?
Thanks