Web Development Stumper

Wednesday, 2007-04-18; 02:55:00

So I'm preparing for the jump to iBlog 2 now that it's in the release candidate stage and it seems to be fairly stable and ready for daily use. (It's been in an extended public beta for several months now.) It's a solid upgrade, with some much-needed interface improvements which allow you to edit the source directly in the app instead of using kludgy HTMLSource pseudo-tags. It also adds in some new capabilities like finally getting rid of those awful category and entry folder names in URLs. iBlog 2 will allow me to make human-readable URLs. Yay!

Anyway, though, I'm having one particular problem with iBlog 2 right now. I've posted a copy of this weblog with iBlog 2 here. The page loads with all the main content smushed into the navigation bar for some reason. The weird thing is that when you reload the page, it all loads properly! I've narrowed down the culprit to the Google Analytics code that I've installed on Technological Supernova, specifically this part:

<div class="side" style="display: none;">
<script type="text/javascript" src="http://embed.technorati.com/embed/mv3p8actca.js"></script>
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
<script type="text/javascript">
_uacct = "UA-463677-2";

If I activate this hidden sidebar item, everything gets smushed on first load. If I deactivate it, the problem doesn't happen. I don't see why this should be the case, though, because all the tags are properly balanced. Indeed, it validates as proper XHTML 1.0. So what's the deal?

If you use the DOM Tree inspector under Safari's debug menu, you can see that on first load, the Google Analytics code doesn't even appear in the DOM tree, and its closing DIV tag doesn't occur either, which seems to cause the problem. But why is the Google Analytics JavaScript disappearing on first load and reappearing when you reload the page?

And one other brief note: if anyone knows how to access .mac webpages via a www.mac.com URL instead of homepage.mac.com or web.mac.com, I'd really like to know. (The reason is that if I can access it via www.mac.com, or, alternatively, if I can access the "Add a Comment" form pages via a homepage.mac.com URL, I can use JavaScript to inject a live preview feature. Unfortunately, JavaScript security features even prevent cross-subdomain scripting -- trying to access a frame on a www.mac.com page is denied from a homepage.mac.com page.)

A cookie to anyone who can figure out either problem. :)

Technological Supernova   Tips   Older   Newer   Post a Comment