Things are getting weirder.
document.body.style.background = “url(images/middle-bg.jpg)”;
document.body.style.background-position = “center”;
document.body.style.background-repeat = “no-repeat”;
AND IT WAS NOT WORKING!!
I tried variations, searched the forums. There were variations like
document.body.background = “images/middle-bg.jpg”;
document.body.backgroundImage = “images/middle-bg.jpg”;
document.getElementsByTagName(“BODY”).style.backgroundImage = “images/bg640x480”;
But none worked.
Finally (and thankfully) intuition told me to try this:
document.body.style.background = “url(images/middle-bg.jpg) center no-repeat”;
And it worked. REJOICE.
But there is a sad part too. The above makes my fear stronger that coding is ultimately a very probabilistic activity. Nothing’s for sure. Sometimes, it is governed by the supernatural.