ebsolutions Posted March 26, 2014 Share Posted March 26, 2014 (edited) 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 March 26, 2014 by ebsolutions Link to comment Share on other sites More sharing options...
davej Posted March 26, 2014 Share Posted March 26, 2014 I'm no jQuery guy but I wonder about your use of .next() in there. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now