010125.html | WebReference


((((((((((((((((( WEBREFERENCE UPDATE NEWSLETTER ))))))))))))))))) January 25, 2001


This newsletter is sponsored by: NetMechanic


This week Nick Del Pozo from 'down under' takes a stand on JavaScript. He gives us a strong opinion on how to write JavaScript in the face of the ongoing browser wars. He has been a casualty for too long and tells us howto script in response to the latest onslaught in the war; the creation ofNetscape 6. We also announce or first Grammar Gotchas winners.

****************************************************************** NetMechanic CSS Tip: Customize Your HTML Tags

One of the great things about Cascading Style Sheets is that they allow you to adjust the behavior of HTML tags, giving you more control over your Web page. With a little work, you can customize tags to work the way you want them to.

Learn more at : http://www.netmechanic.com/ads/f232.htm **********************************************************adv.****

http://www.webreference.com *- link to us today http://www.webreference.com/new/ *- newsletter home http://www.webreference.com/new/submit.html *- submit article

New this week on WebReference.com and the Web:

1. TWO NEW CONTESTS: Submit & Win NetObjects Fusion 5!, Signup & Win! 2. FEATURED ARTICLE: Making a Standard 3. New EGG! Members (Evading Grammar Gotchas) 4. NET NEWS: * Apocalypse Not * Big Blue touts new Napster-proof music locks * Web war rages over DVD-cracking site * Making Money With Open Source

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1. TWO GREAT CONTESTS: Submit & Win NetObjects Fusion 5!, Signup & Win

>Submit & Win NetObjects Fusion 5!

Submit your article today and you could win NetObjects Fusion 5! If your article makes the cut, and we publish it on the site or in this newsletter, you win! This week Nick Del Pozo ponders the browser wars and a new standards-compliant way of scripting JavaScript. See the submission page for details:


>Signup & Win!

Sign up for the Webreference Update newsletter, and you could win a killer software bundle from Ulead Systems, PhotoImpact and COOL 3D. Each week we'll draw new winners from our new subscribers - you could be next. Already a subscriber? Not a problem - just fill out the form, and you'll be automatically entered to win. Tell your friends!


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2. FEATURED ARTICLE: Making a Standard

Anyone with more than a passing interest in Web development will be painfully familiar with the process of diligently having to write two sets of code for every single JavaScript application. Every JavaScript tutorial of recent vintage has inevitably focused on grooming prospective programmers into the habit of writing 'in stereo,' as it were, writing to accommodate the two very different approaches to run-time interpretation supported by Netscape and Microsoft.

Now, with the advent of Navigator 6, and Netscape's new "standards only" approach to browser technology, it's entirely possible to write JavaScript code that is parsed without a hitch by both browsers. Better yet, without a single line of code being repeated. [Ed. note: there are some differences between Netscape 6's and IE5+'s DOMs, but there is common ground.]

I've been writing and maintaining Web sites for nigh on six years now. Currently, my sole project is http://www.iononline.net, a small site dedicated to my band, Ion, and our indy label, Symbiont Records. Iononline.net is low key, designed as a stop off point for fans, with a few downloadable mp3s, and a repository of essays and photos. As such, there's no server side scripting, or dynamic database allocation that needs to take place. There is, however, a lot of incidental JavaScript.

When Netscape released their new browser, I downloaded it, installed it, and then did what any other self-respecting developer would do: took a look at my own site. Immediately I picked up that something was wrong. Nothing worked any more! The image rollovers remained ominously silent. The pop-ups lay chillingly dormant. I'd already spent an awful lot of time working on my code to get it compatible with both breeds of browser, so this wasn't exactly the performance I'd been counting on.

What had befallen me is currently striking a lot of other developers, too. People are waking up to realize that the sites they coded for Navigator 4 are static shadows of their former selves under Navigator 6. I've been quite amused in recent days to find some sites have closed up shop entirely, begging pardon while they attend to the situation. The reason for all the hassle is that Navigator 6 isn't just Navigator 4 with a new coat. It's a whole new browser, from the ground up, and by no means is it compatible with any of its previous incarnations. And the reason for this is a pretty good one.

>Organizing Chaos

Navigator 6 doesn't play by its own rules. With this new release, Netscape has concentrated on creating a browser that is totally standards compliant; a browser that has no "extra features"; that is prepared to follow out the guides set by the W3C to the letter. All very nice, but at the time I was staring at a broken Web site, and I had no idea why, so the advantages weren't instantly apparent. Obviously I was going to have to make some changes to the site, and soon. But what? Desperately running my cursor over once active images, I jotted down a few of my choices.

Firstly, I could hack the existing code to get a Nav6 compliant version. I wasn't particularly enthused by this option for one simple reason, or rather, a lot of little reasons. It wasnÂ’t just one or two pages that would have to be modified. There are literally dozens of individual pages in the iononline.net site, and the prospect of hunting through each of them to change one or two lines of code wasn't so much daunting, as annoying.

Another option was to code a new site from scratch, and simply make allowances for three browsers. The old and new Navigators, as well as Explorer. Again, I was grinding my teeth. What if I spent the next week diligently chopping away, only to have, say, Microsoft release a new version of Explorer? What then, go back to all the pages, hack in support for a fourth browser? I'd already done this once before, when the very first version of iononline.net had fallen flat on its face after being presented with Navigator 4. It was wearing thin.

The third option, though this one didn't quite hit me until I'd spent some time researching exactly why Netscape 6 was treating my code like so much garbage, was to throw everything that I'd learned about basic Web construction out the proverbial window. Netscape 6, of the major browsers, is now the most standards compliant. Second on that list is Internet Explorer 5.5. While both of these beasts have their peculiarities, they're both use the W3CÂ’s approach to the Document Object Model (DOM), and as concerns us and our currently ailing sites, for handling JavaScript. The reason that sites are all of a sudden failing when presented with Nav6 lies in the way they were put together in the first place. When laying down JavaScript, the preferred method is, and has been for a long time, to write basically the one length of code, but to add additional option trees to handle the segments of that code, which are browser dependent. Generally these segments are object referrals, the manner in which you call the browser's attention to something on the page. In other words, they are the aforementioned DOM in action. In order for the JavaScript to figure out which browser it's dealing with, a favorite method has developed in which a programmer will test for certain attributes present in only one of the two browsers. We all thought we were being quite clever when we came up with this, and certainly, it was working out pretty well. Right up to the point where Netscape pulled the rug, and removed all those "test" elements from their browser altogether. At the moment, when Navigator 6 shoulders up to a lot of JavaScript-driven sites, the code is going through with its testing as per usual, but drawing nothing but a big question mark. This leaves the code ambling about, not quite sure what to do. And so it does nothing.

>Starting From Scratch

But the interesting thing is not why Netscape decided to undergo such a drastic change (we can only applaud their decision, after all), but rather how. Netscape is currently a lot more like Explorer than it ever was. Enough that it occurred to me that were I to be careful enough, I should be able to use Netscape's new found "standards oriented" philosophy to my advantage. Rather than endlessly rehashing my previous work, I could write a single piece of new code, one that fell inside the W3C standards, and that (theoretically) would work on both browsers without a hitch. The problem of future browser releases would be taken care of. As long as they kept to the standards, then the page would keep on working.

Which isn't to say bells and alarms weren't going off before I'd finished the thought. While on the surface it may have seemed that by conforming my site to nothing but established Web standards I might actually be maximizing my audience, the truth of the matter was that I could quite possibly be reducing the number of viewers dramatically. While the standards are a great thing, they're held back by one or more unescapable facts of life.

To first, and most obvious problem is that even though standards exist, Microsoft and Netscape have, in the past, been notoriously fond of implementing their own "standards," each steadfastly ignoring what the other was up to, seemingly in order to more effectively wind up with two utterly different ways of doing the exact same thing.

It's not entirely their fault though. The other problem facing standardization is the very nature of the Web itself. The Internet is constantly updating itself, and as such, oftentimes when a new technology comes about, like Cascading Style Sheets for instance, it's already being integrated as a "feature" in browsers before the W3C can take a look at it.

Throw in the feudal style warring between Netscape and Microsoft, as each vies to have their take on the newest technology become the norm, and you're starting to come close to a coherent view on why Web programming can drive those of lesser constitution to tears. And that's not even taking into account the other browsers, like Opera, whose existence most Web denizens aren't even aware of.

>(More) Problems

All this, and I hadn't written a line of code, yet. To say that as long as viewers were using the most recent version of whatever browser the page would display fine was a skewed logic. That would be assuming that everyone's using the latest and greatest. It should come as no surprise to find that there are hundreds of thousands of people who simply don't bother upgrading. Since Microsoft is in the habit of bundling their browser along with every release of Windows, a good percentage of Web users will end up using Internet Explorer simply because it's the easiest option.

To make matters worse, the version of Explorer that ships with Windows 98 is version 5. A version, which, while being moderately well behaved, still has a habit of going belly up when presented with what nowadays should be standardized code. And that's not the least of it. I've been to more than one government office that still uses Explorer 3. By creating a compliant site, I'd effectively (some would suggest ironically) alienate a substantial part of my audience. The question was would it be worth it?

In the long run, of course, yes. The most obvious perk is that down the track, when everyone finally gets around to upgrading, then my site will be there, waiting for them. And I'll never have to worry about coding for additional browsers again. On a more artistic level, the act of actively coding for only one JavaScript method allows for more freedom of expression.

Without constantly hacking work-arounds for troublesome code, IÂ’d be able to focus on the art and elegance that has been sorely lacking in Web-based programming since its inception. Idealistic, and high grounded, certainly, but what about the short term? How many users will be turned down at the door, so to speak? Now, for iononline.net, the problem is less pronounced. We don't actively promote our site on the Web.

Rather, we use it as a second-reference point for people who already know about us. Most of our hits will come around from a listener seeing the Web address written on one of our CDs, and if that's the case, then we're not going to lose money by not logging their hits. In addition, we can be moderately assured that if someone wants to find out about our band badly enough, the act of downloading a new browser won't be all that painful.

It's certainly something for larger sites to mull over, though. For some sites, each visitor is a potential dollar in the bank. And most of these visitors will be ethereal in nature, flitting through the site on a whim, and not likely to be as forgiving of elitist code (no matter how elegant it is). Writing pages that knowingly bars some users from accessing these sites is insane and to do so for seemingly little benefit is even more so. Wouldn't it be better to wait until a large enough majority of users upgrades, and perhaps then to think about rewriting the code?

But then, how long might that be? A month? A year?

>The Revolution Will Be Standardized

The truth of the matter is that for however long developers are going out of their way to accommodate the lowest possible denominator, why should anyone feel the urge to upgrade? It seems that for as long as we are willing to write endless passages of ungainly, accommodating code, people will continue to use what they've always used. Worse yet, while we're willing to support browser specific "features," we're practically inviting the companies responsible for building our Web browsers to do whatever they please, safe in the knowledge that we'll find a way to work it in. And it probably serves us right.

I'm coding the new iononline.net site to be 100% standards compliant. I simply refuse to write my code more than once. It's been tested, and works on both Navigator 6 and Explorer 5.5. Assuming everything goes to plan, it'll keep working well into the future. And while the possibility certainly exists that I might lose my audience, it is not so great as the risk that I might forever be pandering to a disorganized, and self-defeating industry. Besides, there's no greater motivator than finding you no longer have the technology to view your favorite site.

Perhaps if we, as those responsible for piecing together the Web, refuse to write code for anything but the W3C standard, it'll be the Netscapes and Microsofts who'll eventually start writing their programs to accommodate us.

About the author:

Nick del Pozo is the VP at Symbiont Records. He can be reached at http://www.iononline.net and mailto:web@iononline.net ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3. New EGG Members (Evade Grammar Gotchas)

Our grammar contest from Meryl Evans last week was a rousing success.


This little contest proves that one should not rely on Microsoft Word to find all the little mistakes. The intelligent WebReference readers found a couple of more errors than I had planted. Furthermore, some readers found errors outside of the original article (the newsletter or Web site) or in a direct quote that I purposely did not change. These readers receive an honorable mention. Also, some readers presented intelligent grammar-related discussions in a private e-mail to me. They have been given honors.

Presenting, the first official members of EGG! We had to change the name from GASP to EGG after consultation with our lawyers.

Kathryn Andrews Kris Backus Kylie Baxter Jeffrey Bollman Steve Boone Paul Bonney James Britt Karim Brohi Nigel A. Callaghan Rena Clamen Scott Clark Myriam De Clercq Pete Cooper Donna Derrien Richard DiFranco Val Dobson Henry Falk Ann Feeney George Felden Cindi Fitzsimons Dave Francis Simon Francis Richard Funke Iain Gillott Nick Gleitzman Mike Gould Scott Heath Robert Holder Robert Hosken Shari Ingerman Char James-Tanny Sally Jenkins Brian Kavanaugh Ellen Klecanda Kris (kjdlny) Martin Lester Tom Lynn Ian Mackean Devon McCormick Charles OÂ’Flynn Ros Paxman Beth Perkins Brendan Quinn Ganesh Ram Rich Ropes Soctt Sauer Bradley Schmidt Tom Smith Nigel Steane Jack Swearingen Diana Young

The errors:

Note: Several readers commented the apostrophe or quote went the wrong way. This is strange because it went the correct way in the original article. Also, some readers had no apostrophes or quotations in their newsletter or they were converted to garbage (boxes and other weird stuff). These are not errors. However, I added these readers to the EGG list.

"True, I could not care less ( yes, it is correct, if I said, "I could care less." then there is room for me to care even less. In this case, there's no room to grow). If you write sloppy e-mails or blogs - Run-on. It should be:

True, I could not care less ( yes, it is correct, if I said, "I could care less." then there is room for me to care even less. In this case, there's no room to grow) if you write sloppy e-mails or blogs.

My second error occurred, when referring to British English, I said, "use punctuation on the outside of double quotes." The comma needs to move over a notch to "when." My second error occurred when, referring to British English, I said, "use punctuation on the outside of double quotes."

"with whom?" should be "whom." (No "to" or "with" needed because of the phrase "to the person.")

" I will it mention again because itÂ’s one of the biggest nuisances" should be "I will mention it againÂ…"

"Educations institutions" should be "educational institutions." This was a direct quote and not considered an error for this contest. But, I neglected to point it out to you. Good job those of you who caught it.

The article used "e-mail" and "email." I was not consistent in my punctuation of e-mail.

Some of you wrote it should be "nought" instead of "naught." The dictionary states that either is acceptable.

Not to worry, in the immortal words of Arnold, "IÂ’ll be back!" should be two sentences: Not to worry. In the...

"unforgiving for" should be "unforgiving of."

In my bio: co-teaches an Web multimedia online class. Of course, it should be "a WebÂ…"

Until next time...

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4. NET NEWS: Apocalypse Not Big Blue touts new Napster-proof music locks Web war rages over DVD-cracking site Making Money With Open Source

>Apocalypse Not

Is it the end of the dot-com era? Has the fat lady started to sing? See how the U.S. number two tech area is handling the market slowdown. http://www.boston.com/dailyglobe2/022/business/Apocalypse_Not+.shtml 010122

>Big Blue touts new Napster-proof music locks

Could this be the end of Napster or will Napster simply reappear in another form? http://news.cnet.com/news/0-1005-200-4551774.html 010121

>Web war rages over DVD-cracking site

Taking a stand. Find out about the war between an ISP and MPAA (Motion Picture Association of America). http://www.zdnet.com/zdnn/stories/news/0,4586,2678087,00.html

>Making Money With Open Source

You've heard of PHP right? The Zend Engine ring a bell? Check out what the inventors of the Zend are up to? http://www.sa.internet.com/InternetNews/newsarc/01/01/31.htm 010124

****************************************************************** -- AllNet Training -- AllNet Training provides Courses and Events focused on the needs of IT, Communications, Internet, and Development Professionals. Search the AllNet Training Locator for over 5000 instructor led and technology based training courses. http://allnettraining.com **********************************************************adv.****

That's it for this week, see you next time.

Andrew King Managing Editor, WebReference.com update@webreference.com

Alexander Rylance Assistant Editor, WebReference.com arylance@internet.com

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ For information about advertising in this newsletter, contact Frank Fazio, Director of Inside Sales, Jupitermedia Corp. Call (203)662-2997 or write mailto:ffazio@internet.com ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ For details on becoming a internet.com Commerce Partner, contact, David Arganbright, Vice President, Commerce and Licensing, (203)662-2858

mailto:commerce-licensing@internet.com ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This newsletter is published by Jupitermedia Corp. http://internet.com - The Internet Industry Portal ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ To learn about other free newsletters offered by internet.com or to change your subscription - http://e-newsletters.internet.com ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ internet.com's network of more than 100 Websites are organized into 14 channels... Internet Technology http://internet.com/sections/it.html E-Commerce/Marketing http://internet.com/sections/marketing.html Web Developer http://internet.com/sections/webdev.html Windows Internet Technology http://internet.com/sections/win.html Linux/Open Source http://internet.com/sections/linux.html Internet Resources http://internet.com/sections/resources.html Internet Lists http://internet.com/sections/lists.html ISP Resources http://internet.com/sections/isp.html Downloads http://internet.com/sections/downloads.html International http://internet.com/sections/international.html Internet News http://internet.com/sections/news.html Internet Investing http://www.internet.com/sections/stocks.html ASP Resources http://internet.com/sections/asp.html Wireless Internet http://internet.com/sections/wireless.html ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ To find an answer - http://search.internet.com ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ For information on reprinting or linking to internet.com content: http://internet.com/corporate/permissions.html ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Copyright (c) 2001 Jupitermedia Corp. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~