I have an image URL in a imageUrl variable and I am trying to set it as CSS style, using jQuery:
imageUrl
$(\'myObject\').css(\'background-image\', image
Don't forget that the jQuery css function allows objects to be passed which allows you to set multiple items at the same time. The answered code would then look like this:
$(this).css({'background-image':'url(' + imageUrl + ')'})