cdiem
September 22nd, 2010, 04:30 PM
Hello,
I'm playing with user-defined javascript in opera (sadly I'm not good with it). For example, the following javascript:
(function() {
function backgroundToGreen(){
document.body.style.background = "green";
}
document.addEventListener('load', backgroundToGreen(), false);
})();
runs ok when used against e.g. http://dev.opera.com/articles/view/introduction-to-user-javascript/
but has no effect whatsoever when being run against www.google.com. Both wait for the DOM to load, as far as I can tell. Why doesn't it change the background to blue on www.google.com (and a few other websites)?
I'm playing with user-defined javascript in opera (sadly I'm not good with it). For example, the following javascript:
(function() {
function backgroundToGreen(){
document.body.style.background = "green";
}
document.addEventListener('load', backgroundToGreen(), false);
})();
runs ok when used against e.g. http://dev.opera.com/articles/view/introduction-to-user-javascript/
but has no effect whatsoever when being run against www.google.com. Both wait for the DOM to load, as far as I can tell. Why doesn't it change the background to blue on www.google.com (and a few other websites)?