Similar to Twitter, I am trying to allow a user to upload their own background pattern/image. I am wondering what the best way to dynamically change the background pattern on page load is. I am using prototype w/ rails and have been testing by putting the following in my main layout page:
document.observe('dom:loaded', function(){ $('pattern').setStyle("background-image:url('/images/patterns/pattern.png');") })
This is buggy b/c a different background color loads before it is changed with the javascript. Is there a way to change the css even earlier than the dom:loaded event? Is this the right general approach?