Click to See Complete Forum and Search --> : [RESOLVED] Safari backgroundImage


Shawazi
06-14-2007, 07:49 PM
This code works fine in every browser except safari where, after setting the new background image, the value returns the domain instead of the new url. My app changes the background after you upload an image that never existed before.


alert(backArea.style.backgroundImage); //alerts url('/images/bg.gif');
backArea.style.backgroundImage = "url('/images/profiles/temp/<?php echo $main; ?>');";
alert(backArea.style.backgroundImage); //alerts http://www.domain.com/

Shawazi
06-18-2007, 07:07 PM
backArea.style.backgroundImage = "url('/images/profiles/temp/<?php echo $main; ?>');";


was bad because of the extra semicolon before the closing quote. this also broke IE. Firefox was the only browser to ignore the syntax problem, thus confusing me.