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

Popular posts from this blog

apache - PHP Soap issue while content length is larger -

asynchronous - Python asyncio task got bad yield -

javascript - Complete OpenIDConnect auth when requesting via Ajax -