May 30th, 2006 by Aaron N.
via Ajaxian:
I have been using a pattern called the Pseudo User Pattern that many have used over the years.
Basically, it allows users to get through the maximum amount of work without forcing them to signup or login to your application.
Behind the scenes the notion of a User is abstracted and you may be talking to a true user (with a real id) or a pseudo user (with a cookie id).
Read the rest of this entry »
Posted in Best Practices | Comments Off
May 30th, 2006 by Aaron N.
As part of a recent effort to make the CNET headers a little slimmer and to address some possible conflicts with our code and the javascript that runs from ad developers, I took some time last friday to rewrite Prototype.lite.js – distributed by the mad4milk guys (who make moo.fx). Read the rest of this entry »
Posted in CNET JS Standards, Prototype, moo.fx | Comments Off
May 26th, 2006 by Aaron N.
Over the last few months I’ve been writing tons and tons of javascript. When I started using prototype it was like someone let me trade out an old broken down underwood keyboard for a modern one. Writing javascript just got WAY less painful. My code got shorter, cleaner, more complex and simpler at the same time.
As many others have said before, it’s crack for javascript coding. It’s very addictive and once you use it you’ll never want to let it go, and maybe that’s the problem. Read the rest of this entry »
Posted in Best Practices, CNET JS Standards, Optimization, Prototype | Comments Off
May 25th, 2006 by Aaron N.
via ajaxian (of course):
More and more, Ajax apps are using various techniques to keep content fresh in the browser. Essentially, we’re talking about reversing the usual communication flow- the server notices something’s happened, and wants to tell the browser about it. Server ‘calls’ browser, not browser calls server.
The popular Java Ajax framework, DWR, recently released milestone 2 towards a 2.0 release, and introduced the term ‘Reverse Ajax’ in the process, to capture this high-level pattern. This article (via Joe Walker) abstracts the communication details behind a clean API, so you can easily switch between three different implementations of Reverse Ajax: Read the rest of this entry »
Posted in 3rd Party Libraries, Ajax, Server-side Integration | Comments Off
May 23rd, 2006 by Aaron N.
Pardon me for a moment while I stroke my ego a little. About two years ago I designed a contextual carousel for Download.com Music. Across the top were tabs with genre names, and within each genre was a featured artist and four others that you could view. Mousing over the list swapped the featured (large view) artist with the one under your mouse. It looked like this:
One of its traits was that it remembered which genre you last clicked on (a cookie) which meant that if you were a Jazz fan, the next time you visited you’d get a page full of jazz content right up front. Call it cheap personalization. Read the rest of this entry »
Posted in Best Practices | Comments Off
May 23rd, 2006 by Aaron N.
Via ajaxian – looks like I need to refactor some of my code…
In Javascript, you can treat any object as an associative array, similiar to a Map or Hash structure in other languages. So its just a set of key/value pairs – in JS you can add any arbitrary property on the fly. The below example is using an Object, but you could use an Array or RegExp or FooType.
Read the rest of this entry »
Posted in Best Practices | Comments Off
May 17th, 2006 by Aaron N.
via ajaxian:
Google has released Google Web Toolkit (GWT), a code generation framework that lets you code Ajax apps in pure Java. It’s not unlike Echo2, the open-source framework from NextApp. A compiler performs the Java-to-Javascript translation.
- Use your favorite Java IDE to write and debug an application in the Java language, using as many (or as few) GWT libraries as you find useful.
- Use GWT’s Java-to-JavaScript compiler to distill your application into a set of JavaScript and HTML files that you can serve with any web server.
- Confirm that your application works in each browser that you want to support, which usually takes no additional work.
GWT offers tools for remoting as well as a range of widgets: hierachical trees, tab bars, menu bars, and modal dialog boxes. There’s no mention of using these widgets standalone, but hopefully they can be used as pure Javascript widgets in much the same way as Scriptaculous can be used without Rails.
A widget like tree has methods to manipulate the structure (e.g. addItem()) and event handlers (e.g. addFocusListener).
Posted in 3rd Party Libraries, Server-side Integration, Tools | Comments Off
May 16th, 2006 by Aaron N.
http://www.yahoo.com/?p=1147811418
Things I really like about it:
1) the tour is awesome. Stellar. Spectacular. Probably easily implemented.
2) an editable list of shortcuts (the left nav), with a link to show all the yahoo services that just rolls out and then hides when you’re finished.
3) the ‘carousel’ is tabs with words (no 1 2 3 4 5 stuff) with 4 stories in each tab (again, headlines and thumbnails). I love this carousel! Imagine the same thing on cnet except it said news, downloads, reviews, etc. each with 4 features. My only complaint is that it doesn’t remember which tab I previously viewed.
4) Ajax access to your mail, messenger, and local info.
5) an index/tab based search (no drop down) that’s up front and center
6) clean, crisp, uncrowded layout that allows me to drill into categories of interest (the tabbed carousels in particular) makes the page feel light and organized.
Posted in 'Industry' News, Examples | 1 Comment »
May 16th, 2006 by Aaron N.
via Ajaxian:
Related to the post I just made regarding the cost of javascript, I think that something like this might be useful to measure the cpu costs of our implementations.
Jason Orendorff has created a
JavaScript speed test that you can run inline in your browsers.
No one is sure of the usefulness, but it can provide hours of fun as you run the tests on each of your browsers / systems :) Read the rest of this entry »
Posted in Optimization, Tools | Comments Off
May 16th, 2006 by Aaron N.
Looking at the size of the libraries out there (like prototype, which is 50K uncompressed; though if we’re running mod_gzip and the user has a modern browser, they will get a much smaller file) it’s aparent that javascript is increasingly becoming a serious percentage of our page delivery bits. For instance, as I posted previously, Download.com’s home page is 392K, 19% of that is javascript (70K, and that’s not including prototype.js, which is bound to get included sooner or later), 67% images, 13% css and 1% html.
People here will no doubt be quick to ask if we need such a large library included in the page (and indeed, people are). Part of the Javascript Standards Project is to look into all the various 3rd party frameworks out there (currently 134 and counting) and try and make some decisions about which ones meet our needs (if any) and how we will use and deploy them. Read the rest of this entry »
Posted in 3rd Party Libraries, Best Practices, CNET JS Standards, Optimization | Comments Off