Posted in April, 2008

Usable directory listings with a little Dojo April 29th, 2008 at 12:03 am by Sam Foster

I think we’ve all seen Apache directory listings? They are a list of links + icons that detail the contents of the directory. You can go wild with a custom handler to format directory listing requests however you want. But for most cases they work just fine out of the box. They are kind of tedious to browse through though: scroll, scroll, click, or - worse - tab, tab, tab (tab, tab,) enter. A little Dojo magic might go a long way here.

This tutorial shows you how to upgrade those plain vanilla pages to make getting around a little faster and along the way introduce you to some of the most useful bits of Dojo, and practical techniques for working with them. We’ll touch on: dojo.query, dojo.data, the dojo parser and dijit (specifically the FilteringSelect widget.)

(more…)

3 Ways to Upgrade your HTML with Dojo April 28th, 2008 at 12:02 am by Neil Roberts

One of the biggest problems Dojo has when trying to attract new users is the fact that our community rarely promotes one method of writing code as THE WAY. Following suit, I’m not going to say that one method of doing things is better than the next. Ultimately, arguing that there is one catch-all solution to the problems coders face when developing for the web is one way to drive away users as soon as they realize that they want something more.

With this in mind, I’ll outline three strategies available with The Dojo Toolkit. Each offers different levels of control and different benefits. Hopefully, some of the negativity aimed toward some of these strategies is only because of a lack of understanding about their purpose. After some of that has been dispelled, I hope to kill any remaining bad feelings by showing that some of the things you might feel that the toolkit imposes on you can be fixed — with either a simple alias or a simple function.

(more…)

The Best Things in Life are Free April 24th, 2008 at 11:08 pm by Dylan Schiemann

At SitePen, we’re dedicated to creating excellent user experiences and writing clean, beautiful code. Because of this, we’ve earned a reputation as being advocates, advisers and teachers to our friends, colleagues, and clients. As most people know, we’re also the creators, contributors and avid proponents of Dojo, THE JavaScript toolkit being endorsed by IBM, AOL, Sun Microsystems, and many, many more. It is truly, a 100% open source (BSD or AFL) technology that is absolutely free with no tricky licensing issues or EXTensive legal jargon.

Dojo’s thriving developer community and fortune 500 backing makes it the right choice for reputable and responsible companies who are also dedicated to best development practices. For developers and organizations just getting started, here’s our “FREE Top 10 and 100% FREE Dojo FREE Resource List!”

  1. Dojo API Viewer. A full-featured API documentation tool, generated from source code comments and documentation. Features include simple navigation, complete listings of an object’s fields, clear definitions of a field’s type, clear ancestry paths on a field, function parameters, source and examples.
  2. The Dojo Book. An online culmination of extensive examples and detailed explanations about all things Dojo, authored by dozens of Dojo community members.
  3. The Dojo Forums. A community support resource for your learning and research efforts, without thousands of answers to Dojo questions.
  4. The #dojo IRC channel on irc.freenode.net is the place to chat live with contributors and users of Dojo.
  5. Dojo Campus. An up and coming site that contains a collection of articles and demos about Dojo, as well as a feature-explorer showing off the capabilities of Dojo.
  6. Dojo Community Blogs. Popular Dojo blogs include the official Dojo blog, Planet Dojo, SitePen blog, and Ajaxian’s Dojo category.
  7. Dojo Trac. View open and recently fixed tickets, and easily browse the Dojo source tree using Dojo’s Trac instance. Because of Dojo’s very open nature, every code commit, ticket request, and comment can be viewed through Trac.
  8. Dojo Key Links. A reviewed collection of current and up to date tutorials, demos, and articles about Dojo.
  9. Dojo Presentations. SlideShare hosts a variety of conference slides from recent Dojo presentations.
  10. SitePen’s Dojo QuickStart Guide. This is our brand new, concise, easy-to-follow tutorial for getting up to speed quickly with the Dojo Toolkit.

Getting started with Dojo has never been easier and SitePen is always available to lend a helping hand! We offer Dojo training workshops, commercial Dojo support packages and of course, premier design and development services, brought to you by the best open source, web company around.

Unit Testing Custom Code with the Dojo Objective Harness April 15th, 2008 at 10:50 am by Dustin Machi

Many Dojo developers are aware of the Dojo Objective Harness (DOH) that the Dojo Toolkit uses for unit testing. Many people, however, want to use DOH for testing their own code or even non-Dojo code that they have written. While DOH has always supported this, there currently aren’t many examples of doing so. Let’s see if we can help that out.

Out of the box, DOH has supported custom code since the beginning. Tests can include any custom namespaces or code by easily using standard JS techniques. Coming to an understanding of how custom namespaces work with Dojo and how and when DOH loads tests will help us illustrate how you can take advantage of DOH in your own code.

(more…)

XHR Plugins with Dojo using handleAs April 14th, 2008 at 3:45 pm by Neil Roberts

Dojo’s Ajax system provides much more than basic text retrieval. As you might have already discovered from the pages in the Dojo book on using both text and JSON versions of Ajax requests, as well as the API page for dojo.xhrGet, the handleAs parameter lets us specify how we want the returned data to be parsed.

From the API page, on the handleAs parameter:

Acceptable values are: text (default), json, json-comment-optional, json-comment-filtered, javascript, xml

What you may not know is that the handleAs parameter is merely a way of specifying what plugin to use. Knowing where these plugins are, how they work, and how they can be adapted to suit your project will allow you to make repetitive tasks easy and less error-prone.

(more…)

Retiring the 3 Column Layout April 11th, 2008 at 1:25 pm by Damon Dimmick

In today’s blog post I’m going to be talking about one of the most recognizable layout models on the web today, its flaws, and some suggestions for retiring this old chestnut.

The traditional 3 column layout

The culprit here is the reliable fall-back of web layouts: 3 columns, with the main content centered. It’s used in a wide range of websites, from e-commerce to news outlets, and has become the default model for many content management systems. Although there are times when the 3-column layout is appropriate, more often than not the layout is abused, degenerating into a poorly implemented default.

(more…)

I’m Not Flash April 8th, 2008 at 12:00 pm by Peter Higgins

Much like a magpie, I find myself oddly infatuated with shiny things. When a UI component somewhere just screams elegance, I find myself compelled to use it. A lot of the time a simple right-click will indicate the said UI was implemented in Flash, and it loses a tiny piece of street-cred.

I’m most impressed by FX when they enhance the user experience. By using subtle FX during transitions (or an element fading out rather than harshly ‘disappearing’ for example) we give our users an added element of flair while requiring nothing of their browser other than JavaScript being enabled. Any marketing type will tell you the value of a first and lasting impression. The UI really is the only thing the customer sees, isn’t it?

(more…)

Balancing Security and Convenience April 7th, 2008 at 5:39 pm by Dylan Schiemann

At SitePen, we value amazing user experiences. Once in a while, you see an elegant solution to a problem that has annoyed users for years.

For most consumer web sites and web applications, logging a user out of a service after a certain amount of inactivity is not very important, and does more to annoy a user than anything else. In the enterprise or when using bank web sites, security is a far greater concern, and most services resort to logging users out automatically after 15 or 30 minutes of inactivity. This is especially frustrating for users of advanced web apps, which might require several clicks to restore the user interface back to the state it was in before the session timed out.

(more…)

Dojo 1.1 in the News April 4th, 2008 at 3:56 pm by Dylan Schiemann

Since Dojo 1.1 was released a week ago, several outlets have published articles:

Advanced JavaScript Debugging Techniques April 3rd, 2008 at 1:53 pm by Mike Wilcox

The purpose of this article is to provide a list of advanced debugging techniques that are not easily found elsewhere on the web. Using Google to search for JavaScript debugging just gives you hundreds of articles about using alerts and how Firebug works. We all worship at the altar of Firebug, but there are things that can go beyond a console.log(). The following is a list of methods that every developer should have in their toolbox.

(more…)