javascript bg image
- From: warth33@xxxxxxxxxxx
- Date: Thu, 28 Feb 2008 15:06:53 -0800 (PST)
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?
.
- Prev by Date: Re: block writing
- Next by Date: Re: newbie.. why "return false;" ?
- Previous by thread: innerHTML and grave symbol
- Next by thread: FAQ Topic - How do I trim whitespace - trim/trimRight/trimLeft (2008-02-29)
- Index(es):