RSS

'Gadgetry' Archive



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.





Sep
14
3

iTunesandvidsandmore, version 7 (or, Introducing AguaT)

I know I’m late to the iTunes 7 party, but there’s a reason for that: I’ve been working on something, but I’ll get to that later. Right now, the latest version of iTunes, version 7, is standing beneath my web browser obsequiously serving out tunes for my listening pleasure. Not much has changed, it would seem, with the way iTunes is used as a background application (what can change?), but Apple’s goal is to keep you using iTunes in the foreground as much as possible.

I’ll start out with the positive things first. I like the new sidebar layout. The old layout, though functional, always annoyed me to some degree because the playlists were on the same level as the entire library, even though they were all technically subsets. This new layout is organized very well. The new iPod features also look very compelling, though as the FireWire bus on mine has shorted out, I have yet to try them for myself.

Another thing that one notices about iTunes is that it took a lot of cues from Windows Media Player, and that’s not necessarily a bad thing. Upon seeing WMP11’s new emphasis on cover art, my initial reaction was “Cool, I wish iTunes would do that”. The 2 new views make heavy use of cover art - one a cue from WMP, and the other bought from a small developer. I won’t get much use out of either of them, but they’re undoubtedly cool.

But iTunes 7 wasn’t all bliss. The initial “wow” factor of all the new features was dampened by a “WTF” reaction to the new interface. Aqua is, apparently, passé now that Apple has moved on to grayer pastures. “Lickable” has been replaced with cold hard steel, something reminiscent of the XP widget scheme (ironic that Apple is moving away from Aqua just as Microsoft is just discovering it with Vista). These widgets are most likely a foretaste of things to come in Leopard - and the simpler gradients are also giving rise to rumors of a completely vector-based interface. That would indeed be really cool, but certainly not at the expense of Aqua.

OpenThis is where the announcement comes in: Introducing AguaT, the complete Aqua solution for iTunes 7. Not only does it go back to the iTunes 6 look, it also aquifies some of the widgets that were metallifized several versions ago, as well as doing another trick or two. You can check out the program page for screenshots.

Taking cues from WMP is, like I said earlier, not necessarily a bad thing, but on the other hand, it certainly can be. A complaint I’ve had since version 6, though more accentuated now, is that I don’t like the way iTunes is becoming a catch-all media organizer like WMP. I can hold practically any sort of media in iTunes now a la WMP - something I don’t want in my music player. But, to my relief, iTunes does have options for disabling all the superfluous junk in the sidebar like Podcasts, Videos, TV Shows, etc. So until it demands that I respect its video functions, I’m ok with it. iTunes 7 really is a great upgrade - the features are compelling, and thankfully the homeliness is only skin-deep.





May
13
0

IE7 Beta 2

As the saying goes, a dressed up pig is still a pig. Beta 1 was a dressed up and rather confused pig, but IE 7 Beta 2 has moved on to being a tramp dog: Attention-seeking, sort of ugly, not too smart, spastic, and omnipresent, but better than a pig.

The first thing that I noticed about IE 7 Beta 2 is that it won’t install with Beta 1 already there. It won’t upgrade, it won’t remove it itself, it basically says “No. I won’t install unless you uninstall Beta 1″. It took me a while to figure out where the uninstall was, because it classifies itself as an update, which is hidden in the “add/remove programs” window by default. Strike 1.

After it installed, though (which took about an hour. Zzz…), I immediately went to test the most glaring omission in Beta 1: CSS rollovers. They simply didn’t work under Beta 1. They even work in IE 6. Worse CSS support than IE 6? That’s embarassing. But, to my elation, rollovers do indeed work. Hallelujah! In fact, CSS support overall seems to be much improved over Beta 1 (which itself was virtually no improvement at all over IE 6). Lucky for Microsoft, because if they didn’t fix the abysmal CSS support in 7, web developers from all over the world would march on Redmond and burn the IE department to the ground.

The tab rollovers were slightly different in B2 than B1, but that was the extent of the cosmetic changes. The whole tab bar, though, being always on, screams “Hey! We’ve got tabs too!”. Good job, we’re proud of you for being YEARS late to the tabs party and then implementing them tackily. Even more tackily than FireFox’s, which is pretty tacky too, though not always on.

IE 7 is also the latest victim of Microsoft’s crusade against menus, which are thankfully reenablable, though they appear below the toolbar. Tacky again. If menus are confusing to noobs (Microsoft’s argument), then removing them is restrictive to everyone else. If you’re worried about noobs, then start by overhauling the convoluted and ridiculously complicated control panel system. And the XP view doesn’t count, because it doesn’t make it any less user-friendly.

IE7 does have some innovative features, though. I haven’t tested it myself yet, but the print preview system seems like an incredibly handy feature. It can delete parts of a webpage before printing - after all, why print a 500 pixel wide full-color header, or a group of ads? Their implementation of the forward and back buttons, though minor, is also nicely done. Instead of holding down the back or forward buttons to see all webpages ahead or behind the current one, there’s an extension of the button set that shows all the webpages both before and after the current, with the current highlighted.

Hopefully IE 7 final release will feature spec-complete CSS2 support (or at least close, since they already said it wouldn’t pass the Acid2 test). That’s the one feature that I want more than any other, for the sake of people on the internet, and to make my life as a web developer easier, seeing as I don’t use IE anyway.





May
05
6

Typosquatting? Gimme a break.

Over the last few days, Google (and even Yahoo) have been taking flack for profiting off of unsavory websites. The first case was one of Google and Yahoo ads being served on typosquatting pages (domains that are similar to a more well-known one, i.e., bistbuy.com), which obviously make money for them.

Now, spyware was also an issue in the Yahoo suit - and the articles are not clear as to whether Google’s service Oingo actually owns the domains or simply serves ads to them, but I seriously doubt that any consumer would become legitimately confused by a parked domain lwoes.com as opposed to lowes.com. If they do then they should not be using the internet.

Sure, parked domains are annoying, but you don’t file a lawsuit when something annoys you. In the case of the spyware being installed, then sure, go for it, but it takes all of 2 seconds to correct a typo and get off the parked domain.

Now, another case against Google, which is along the same lines but infinitely more ridiculous, is the allegation that Google is profiting from child porn by having purveyors advertise on its AdSense service. If I ran a network like that, it would be completely laizzes-faire, and I know Google removes obscene content once it is made aware of it, according to their policy. The allegation that Google “intentionally inflicted emotional distress on the public” is patently ridiculous.

This is just another case of someone trying to exploit the legal system for a quick buck. Why on earth should Google pay the prosecutors if they lose? The prosecutors were not harmed even slightly more than the general public, so if anything, it should be a public debt. The fact that they are seeking “unspecified monetary damages to be determined at trial” doesn’t help their case any in my mind.