It's very rare that I get stumped when putting together a theme for a website, my skills are good enough to be able to fix most problems and because I know the terminology in most cases I can find something on Google when I need more.
However, there is something on my blog that is annoying the heck out of me and its due to the widgets in the sidebar and in my posts, and the way the browser renders the page. People on really fast connections might not notice it, but I do, so I thought I'd describe the problem and tell you how I've applied a band-aid to try and resolve it.
Here's the problem, this theme has a blue background. The posts and sidebars have a white background. When the page is rendered by the browser, the basic structure renders with no problem, but the delay in getting the widgets to do their thing means that by the time the browser has finished rendering the page, several seconds will have elapsed where the page doesn't display correctly.
To try and correct the problem I've removed several widgets, but it can still be a little slow. The other thing I've tried is giving the entire page a white background and using a blue square of only a few pixels that I tile across the page, however this didn't work. My final attempt has been moderately successful, I gave the post column and sidebar column a white background in the CSS.
At least now the post is still readable while the page completes rendering. Now some of you are probably wondering what the actual cause of the problem is. Well, quite simply its the blue border and white content area that is causing the problem, and its being made obvious by slow loading widgets.
Another possible solution is to remove the bookmarking widget and replace it with static icons loaded from my own host rather than rely on a third party site to help my readers out. Doing this will remove some of the page load overhead, but won't completely solve the problem because the BlogCatalog and AddFreeStats widgets are being served a lot slower these days than they used to be.
I don't want to remove the blue background, and I don't want to render the widgets at the end of the HTML since it would require positioning them absolutely. Arghh!
Does anyone have any suggestions? My only other thought is that I could use an iframe in the sidebar so that the browser can complete the rendering process but I haven't tried this and it means a lot of extra work. Your Thoughts?
AmeriGlide said,
Wednesday, June 18. 2008 at 12:38 (Reply)
nicole said,
Thursday, June 19. 2008 at 08:50 (Reply)
The new look is very attractive, btw!
Carl said,
Thursday, June 19. 2008 at 09:14 (Reply)
It's even more disappointing that you've noticed it on a fast connection, kinda suggests I have some work to do. I wish the widget people would speed things up, then it wouldn't be a problem, so now my evening will be spent looking at CSS instead of watching TV.
Costa Rica SEO said,
Thursday, June 19. 2008 at 13:40 (Reply)
You can delay the script from running until after the page has loaded. In IE it's as simple as adding "delay" inside the SCRIPT tag.
for cross browser support though it will involve a little programming. I suggest checking out the window.onload=function():
http://www.evotech.net/blog/2007/05/including-javascript-in-xhtml/
If you like I can write some sample code and e-mail it to you to test.
Costa Rica SEO said,
Thursday, June 19. 2008 at 14:06 (Reply)
DeadRooster said,
Friday, June 20. 2008 at 14:39 (Reply)
If you have a wordpress blog, you can download a plugin called, IFrameWidgets:
http://www.scratch99.com/wordpress-plugin-iframewidgets/
Hope this helps.