W
warth33
Hello
I have to change a div's background image on the fly. The problem is
that the url is built on the fly too.
var url = link.replace("a", "b");
Thus the location of the image is contained in the variable url. How
do I pass this to the function?
document.getElementById('img_div').style.backgroundImage = "url( '" +
url + "') ";
This of course didnt work. I have tried a lot of alternatives, putting
\ almost everywhere. But none worked. is there a solution to this?
I have to change a div's background image on the fly. The problem is
that the url is built on the fly too.
var url = link.replace("a", "b");
Thus the location of the image is contained in the variable url. How
do I pass this to the function?
document.getElementById('img_div').style.backgroundImage = "url( '" +
url + "') ";
This of course didnt work. I have tried a lot of alternatives, putting
\ almost everywhere. But none worked. is there a solution to this?