memory trip: excite

Once in a while it's fun to go back in time. While reading code from GMail, Yahoo mail, live.com and similar complexified beasts it makes me smile to access Excite.com and peek at their source. They aren't into redesigning or rewriting stuff over there, the code is still the same stuff. Some five years ago, this was as complex to me as Yahoo's script is today – I was astonished at the strange approach of using document.write to generate a lot of the "common" markup like headers and banners.

How time flies and people learn..

Advertisements

7 thoughts on “memory trip: excite

  1. Originally posted by hallvors:

    strange approach of using document.write to generate a lot of the "common" markup

    I must admit that I used this too in my personal website. It doesn't "feel right" though and since you call it a strange approach, I hope you have a suggestion for improvement. What I do is the following: I have certain elements that I want to hide by default and then use some JavaScript to show them when the visitor wants to. But I don't want to be unfriendly to those who have JS off. My approach is to hide these elements with JS (so people without JS can still see them). The option to do it from <body onload="hideElementsFunction"> has an ugly side effect, namely that for a split second you do see all contents of the page until they're hidden by the script. So I inserted a <script> element in the <head> of my document, which document.writes a style element doing the trick for me. The good thing is that it is simple and works in my three main test browsers (Opera's latest final, FF latest version, IE7). The bad thing is that I'm probably demonstrating I still have much to learn about coding. ;)Btw, here's the page I'm talking about.

  2. Excite was always a headache for me in the days when I maintained a newsletter distribution system; their web based email service would always be the odd one out as it would fail to display the images for my HTML newsletters – not that I like HTML emails, but still, annoying! 😉

  3. Totally inappropriate place, but what’s wrong here?

    $ cat .opera/browser.js 
    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
    <html><head>
    <title>404 Not Found</title>
    </head><body>
    <h1>Not Found</h1>
    <p>The requested URL /userjs/index.pl was not found on this server.</p>
    <hr>
    <address>Apache/2.0.54 (Debian GNU/Linux) mod_perl/2.0.2 Perl/v5.8.4 Server at xml.opera.com Port 80</address>
    </body></html>
    
  4. scipio: I would do this with CSS like BODY.jsenabled .lowfi{ display: none }and then just run document.body.className+=' jsenabled';somewhere in the document. Of course the quirk here is that it must not run until document.body has been defined, but adding a script with this content anywhere inside body should work in most if not all browsers..

  5. Originally posted by hallvors:

    scipio: I would do this with CSS like BODY.jsenabled .lowfi{ display: none }and then just run document.body.className+=' jsenabled';somewhere in the document. Of course the quirk here is that it must not run until document.body has been defined, but adding a script with this content anywhere inside body should work in most if not all browsers..

    Thanks, hallvors. Do you really consider this more elegant than using document.write?

  6. @scipio: In this case, I think that's not too important. But for more complex stylesheets you'd want to have everything in one place, not distributed between different stylesheets (one of which is in a script, which is in the actual markup). That's where hallvord's method is more efficient.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s