I wanted to make the script very reusable and be able to just drop it into the head. At the bottom of my javascript file I had this
window.onload = OPbannerToDOM('somevalue');
I was thining this would run once everything in the page had loaded? Was this the right way to do this?
Thanks - I totally forgot that method.
I do however have an issue, both methods cause an error?
document.getElementsByTagName("body")[0] is undefined
document.getElementsByTagName('body')[0].appendChild(bnr);
Is that because the script is in the head and the body has yet to load?
Hi all,
I'd like to add some html to the top of the body tag. I was thinking something like this snippet below.
However, the commented out line adds it to the html tag inbetween the head and body and the next line doesn't work
var bnrContent = "";
var bnrLink = "";
var bnrContentHTML =...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.