Got a problem on gaydemon. My banner program is using a javascript which sits at the bottom of column 1 (main content). This causes the column 2 (right hand side column) to load later than the main content.
It means that for a short time you dont see any column at all, because the javascript is excecuting first before it then goes on to loading the rest of the page.
Now, how can I change so that the javascript doesnt excute until the whole page has loaded?
Are you saying that if you take out the banner ad at the end of the main column that the page loads differently? Browsers typically render the page from top to bottom of the HTML document (not the visible page). What you’re seeing could be completely normal if the main column is somewhat complex. Take out the banner ad and see if there’s a difference. I’m guessing it’ll be about the same.
Thats exactly why it loads a bit strange. THe browser reads top to bottom and because I use CSS only for layout the right hand column comes after the bottom banner.
So it reads half the page, hits the java (loads java) then continous to read the rest of the page.
Its only when I use this javascript way of calling a banner.
[QUOTE=gaydemon;23940]Thats exactly why it loads a bit strange. THe browser reads top to bottom and because I use CSS only for layout the right hand column comes after the bottom banner.
So it reads half the page, hits the java (loads java) then continous to read the rest of the page.
Its only when I use this javascript way of calling a banner.[/QUOTE]
If it bothers you (not sure how big of a problem this really is) - I’d suggest putting the Javascript at the bottom of the page and having it rewrite the contents of a blank <div> you’ve declared previously at the original location. You’d be doing something similar to what SWFObject does in terms of rewriting the div.
[QUOTE=gaydemon;23941]I tried defer=“defer” earlier today, but the page just froze. I’m not sure if you can use defer on a javascript which isnt a seperate file.
Its the onload event Im hoping might work, but I dont know how to add or use it. Any ideas how I can add a onload to the above javascript?[/QUOTE]
Oops. Yeah, the defer is for external files.
You would need to put the script into a function in the header. And call it in a div element. Search for putting javascript into div elements.
Thanks to you both, I think thats what I am trying to figure out. Someone else suggested doing it by CSS Positioning but that can just go so very wrong and gets messy.
I’ll look that up then. THanks!
[quote=Nicedreams;23948]Oops. Yeah, the defer is for external files.
You would need to put the script into a function in the header. And call it in a div element. Search for putting javascript into div elements.
I tested and tried every bloody solution to serving banners for OpenX.
In the end, Ive had to use Iframes. Even if i dont like em…
But its proved to be the only solution which does not slow down the loading time of the page.
Anyway just for future reference. Unless you have Openx installed on the same server as where you are serving the banners, there is no way of not getting a delay. Only solution for now is Iframes.