ruby on rails - How to load precompiled images using jquery? -
in rails application changed navbar icons using jquery, when images precompiled image name 'nav1_completed-0d81e4b2c254459e456870960fa480c2.png', how load image using jquery?
$('#nav1').find('img').attr('src', "/assets/nav1_completed.png");
when load above function doesn't load image since names different, how load images using jquery?
you can try below check if image name starts nav1
$('#nav1').find("img[name^='nav1']").attr('src', "/assets/nav1_completed.png");
Comments
Post a Comment