Jump to content

.each issue - not displaying last element


ebsolutions

Recommended Posts

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.

$(".picture img").each(function () {    var caption = $(this).attr('src').replace(/.jpg/, '').split('/').pop();    $(this).parent().next().text(caption);});

 

 

 

Any ideas what would cause this to happen?

 

Thanks

Edited by ebsolutions
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...