Background Image comes up as white when displayed using Javascript

Posted by AndroidNewbie on Stack Overflow See other posts from Stack Overflow or by AndroidNewbie
Published on 2013-07-03T17:02:38Z Indexed on 2013/07/03 17:05 UTC
Read the original article Hit count: 250

Filed under:
|
|

I am trying to change the background image whenever the document is loaded, and when it hits this point:

document.body.style.backgroundImage="url('../images/mobile-bckground.png')";

The page simply makes the background plain white. It is displayed like this in my javascript:

$(function() {
    document.body.style.backgroundImage="url('../images/mobile-bckground.png')";

});

I have verified the image is in the right location, why is it doing this?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about html