RSS

Archive for October, 2006



Oct
05
0

Freshening Websites with AJAX: Myths and Pitfalls

AJAX Over the past week, I’ve discovered some really neat things that AJAX - Asynchronous Javascript And XML - can do. I’ve now got the photo galleries equipped with something called Lightbox to overlay clicked images over the page, rather than opening a new one or changing the current one. Check it out - click on an image and watch the fullsize pop up in the same window.

More practically to the site as a whole, though, came a Live Search Wordpress Plugin. The code was flexible enough to graft into the theme itself - type something into the search box up top to try it out.

The reason I’ve been so late in implementing things like this has been because of misconceptions which have since been abolished, and because of trepidations I still hold to.

Misconceptions:
1) You need to know Javascript to understand AJAX, or AJAX is hard to implement
Personal testimony here: I don’t know a lick of Javascript. Any I have ever used, which is not much at all, has been scraped from other sites doing what I needed. By my logic, since all the Javascript I’ve ever had to implement has been complicated, AJAX, being much more powerful, must be much more complicated to maintain. But Javascript use has evolved considerably: All that’s usually required for a good AJAX module is inserting a script or two in the header and that’s it. With Lightbox I had to add a ‘rel’ tag to the images, but even that’s not terrible, and I don’t have to soil myself messing with any Javascript whatsoever.

2) Javascript will dirty my code
Old-world Javascript - all of what I had seen in the past - could easily take a beautifully structured and semantic (X)HTML document and make it look like complete garbage. onmouseover, onmousedown, and onmouseout tag properties could drive a developer insane trying to keep up with the script contained in a tag. But Javascript has evolved considerably since then. One of the more remarkable things I’ve noticed is that instead of using mouseover/down/out properties on tags, Javascript can now operate on a tag based on any attribute at all. This makes for extremely modular Javascript with virtually no trace of it in the markup at all. Lightbox recognizes links it’s supposed to operate on by a rel=”lightbox” attribute, and live search was built to automatically recognize the class of the search box - no code editing at all required beyond adding the script tags to the header.

3) AJAX locks my site into badly degrading features with bad cross-browser support
Actually, AJAX degrades extremely well. Without Javascript enabled, Lightbox will just open the image URL in the same window, and without live search, there’s always regular search, which has been there from the beginning. No gremlins appear without it enabled, and because it doesn’t dirty the markup, text-based and mobile browsers won’t notice a difference. As for browser support, because AJAX is generally implemented by libraries such as Scriptaculous or Prototype, browser compatibility is as reliable as it can get, which is surprisingly good.

But as great as AJAX is, it must of course be used in moderation. The trepidation I had about implementing it still exists, for these reasons.
1) It’s distracting and pointless
As much as I love last.fm, I don’t like their summer website update for a number of reasons. But all the others aside, the relevant reason is that it’s simply tacky. They make good use of AJAX in some places such as live deletion of recommendations and live posting to shoutboxes, but the site as a whole is overloaded with visual effects. Minimizing sections on the side produces a fancy-looking scroll effect to zip the section into its header. My objections to moving layouts aside, the scroll effect is just silly. In fact, most of the effects that people use AJAX for nowadays are silly. It adds processing overhead to the site, is visually distracting, and takes more time than a simple disappear. As one can see after 5 minutes of browsing places like Myspace, people like bells and whistles. We found this out in the 90s when the Geocities website stereotype chock full of animated gifs and marquees emerged. Thankfully the ones that know enough to implement AJAX generally do it in a much more tasteful manner than that, but it is nevertheless an unnecessary and visually distracting effect. As AJAX becomes more accessible and mainstream, we may find that AJAX becomes the animated GIF of the 2000s.

2) Overhead
This one’s pretty self-explanatory, and unlike the previous point, this one is a downside to all AJAX use, not just the tasteless variety. Javascript libraries get big - prototype.js will run you up 52k, more than the entire sidebar of this page including images.

AJAX is a pretty amazing tool - I’m having fun playing with it and am impressed by its capabilities and cleanliness, but as with anything, moderation should be the rule.





Oct
01
0

Dotcom Bust, Part II

As great as the economizing potential of the internet is, we must be careful not to put our stock (literally and figuratively) in unsustainable or doomed business models. The “dotcom bust” of the late 90s was a mild economic crash caused by entrepreneurs getting excited by the potential of this new medium of the internet - excited enough to put billions of dollars into hundreds of ambitious companies like WebVan, an online grocery shopping site, and boo.com, a fashion retail site with a 3D avatar (from PCWorld’s The 25 Worst Websites), which promptly went bankrupt without sustainable business models.

If history teaches us anything, it’s that people don’t learn from history. Whereas the first dotcom bust was limited in scope because it burst before it could build itself high enough to do any serious economic damage, the internet at large seems to be headed for another, exponentially more massive economic bust barely a decade after the first, for exactly the same reasons.

The company that pioneered this business model has become immensely popular in recent years, and has skyrocketed in stock value from an initial $85 just over 2 years ago to $401 as of this moment (CNN Money). It has pioneered amazing innovation in areas such as webmail, sattelite photos and maps, and most obviously, websearch, all from a single income source. The company? Google, and their income solely from advertising.

Now Google is an amazing company, but it exhibits remarkable similarities in many ways to doctoms of the late 90s. For example:

  • Vastly inflated stock prices due to investor excitement over an income method
  • Extravagant spending: The Googleplex campus is equipped with a fleet of Segways, an army of masseuses, all-you can eat snacks nearly everywhere, and free meals provided by the former chef of the Grateful Dead, who has since left Google (CNN)
  • Gigantic investments with no revenue potential: Google has bought the companies Keyhole (Google Earth) and Sketchup (a 3D modeling program), and has developed programs like Picassa and Google Desktop - none of which bring in any revenue

Now I’m as much a fan of Google as the next person, but their revenue model as an advertising producer, which is also being employed in more or less the same manner by companies like Yahoo, cannot last for much longer.

On the consumer end, people are becoming less and less tolerant of advertising. No matter how targeted ads may become, most people simply ignore anything that looks like an ad - and the particularly savvy users may block them completely. Programs like PithHelmet for Safari and Adblock for Firefox are becoming increasingly popular as people get increasingly sick of online advertisement. Advertising is unpredictable enough to obfuscate any earnings that may come from it indirectly (for example, did a user visit this site because of an ad, or for another reason?), but eventually advertisers will realize that the cost of advertising isn’t made up for by increased revenue.

In addition to decreased revenue from placing advertisements, there’s an increasing market for clickfraud, increasing advertiser costs with zero increased revenue. According to the article, it’s a booming business despite efforts to squash it, and advertisers are signing off en masse because of it.

Whether this happens all at once or gradually, it’s practically inevitable that it will happen. Google can’t last forever on an advertising supported revenue model, and whether its fortunes crash or crumble, the impact will not be small. Thousands of sites are supported solely by advertising money paid out by Google, Yahoo, and other advertising providers, and in many cases make a good bit of money off it. Advertising money from displaying ads is becoming more popular as a business model for immensely popular sites like Facebook and Youtube, and most of the internet makes money in some way or another from ads. Even this site displays Google ads for some quick money (though it’s hardly dependent on them; I’ve made all of $9 so far). Sites like these dependent on ad revenue will go down with Google and the other ad providers that pay them, leaving a scarred internet and a broken economy.