I am trying to change the background image of an element through jquery like this;
$j(this).css('background-image','url(images/client_box_grad.gif)');
However when it renders it seems to drop speech marks around the the url, eg
$j(this).css('background-image','url("images/client_box_grad.gif")');
And this means the image isn’t visible – if I remove the speech marks in Firebug then the image shows up.
Any ideas ?
The double quotes are not necessary:
You should make sure that you have specified a valid image url. Here’s a demo.