I a bit of noob and a magpie when it comes to using code in any web project I have tried. I'm still new to the game here.
Currently I'm building an Information Panel for my office network that will sit on the Active Desktop (We are still tied in to IE8 here so there's nothing modern about anything I can use!)
What I'd like is the ability for the user to have the Info Panel full screen on their desktop and then set the background of the tag to a desired image.
Currently I have (in a very raw form)
<script type="text/javascript">
function setBackgroundImage()
{
var url = document.getElementById('bgchanger').value;
document.getElementsByTagName('body')[0].style.backgroundImage = "url('" + url + "')";
setCookie('userbg', url, 30);
}
</script>
<body onload="setBackgroundImage()" id="bg">
<input type="file" value ="Look" name="myFileSelect" input type="text" id="bgchanger" placeholder="Change Background Add URL" />
<input type="button" onclick="setBackgroundImage();" value="Change!" />
Which enables a user image selection plus setting of a cookie.
The bit I don't know is how to retrieve it and set it.
Clearly there has to be some logical stuff in there to check for a cookie, set the value as the background and not use the inputted text if one exists.
Any help gratefully received.