My code:
<html>
<head>
<script type="text/javascript" charset="utf-8">
function backgroundImage() {
document.body.style.backgroundImage='url("http://www.image.jpg")';
}
</script>
</head>
<body onLoad="backgroundImage()">
Content here
</body>
</html>
But the addition of document.ready:
$(document).ready(function () {
document.body.style.backgroundImage='url("http://www.image.jpg")';
});
breaks the code
Why does this not work, something I’m missing, or prefix of document.ready just not needed? Could it be that ‘document’ should not be called twice?
Thanks in advance!
Kind Regards,
Dale
This is no problem, can run
http://jsfiddle.net/HRhQW/