I am trying to change the image src attribute using jQuery
jQuery(\"#imageID\").attr(\'src\',\'http://localhost:8080/images/1/myImage.png\' );
It's because the url() string is wrapped around it. You'll need to strip it from the string, for example using the replace function...
var bgimg = jQuery("#imageBlock").css('background-image').replace('url(', ''); bgimg.replace(')', '');