SitePen Blog Category ‘JavaScript’

The Latest from SitePen Labs May 13th, 2008 at 12:01 am by Dylan Schiemann

We’re pleased to announce the two latest projects from SitePen Labs: Paver and Persevere!

(more…)

String Performance: an Analysis May 9th, 2008 at 12:02 am by Tom Trenka

Recently I was writing a “tips and tricks” blog post that was going to focus on the idea that it is better to use an object as a “string buffer”; the idea was that by passing this object around to various functions and pushing string fragments into it, you can get better performance from a JavaScript engine. My friend and colleague Alex Russell challenged me to show him hard data supporting this hypothesis—and the results were quite eye-opening!

String performance by browser

(more…)

Porting Dojo Methods to Flash - Part 3 of 3 May 8th, 2008 at 12:01 am by Mike Wilcox

This is the final part of our three part series on porting Dojo methods to Flash.

In part one of our series, we implemented Dojo’s hitch method, and then used hitch in part two, where we made our connect method. In part three, we will be using both of these methods as we connect a JavaScript object to a Flash object.

(more…)

Dojo JSON-RPC + Java May 6th, 2008 at 12:01 am by Kris Zyp

Dojo supports JSON-RPC, which is an easy to use JSON-based remote method call format. JSON-RPC can be utilized for an interoperable approach to distributed computing and communicating with servers. We will look at an example of interacting with Java on the server and invoking a Java method from JavaScript using Dojo’s RPC services. We will be begin by demonstrating a simple JSON-RPC handler written in Java. First we will create a servlet and write a POST handler that will read the content from the request:

public class JsonRPC extends HttpServlet {
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) 
		throws ServletException, IOException {
         String content = streamToString(req.getInputStream());

(more…)

Why Java remains the most popular language on the JVM May 5th, 2008 at 12:01 am by Kevin Dangoor

Mark Ramm-Christensen posed some questions about using the JVM as a platform for dynamic languages. Many people do, in fact, use dynamic languages on the JVM (Groovy, Beanshell, Rhino, Jython, JRuby are some big ones… and don’t forget Scala, Nice and other “non-dynamic” languages that target the JVM). But Java the platform has not gotten widespread or serious attention until recently (witness the recent resurgence of Jython, the rise of JRuby and the coming of the Da Vinci Machine).

(more…)

Porting Dojo Methods to Flash - Part 2 of 3 May 2nd, 2008 at 12:01 am by Mike Wilcox

Adobe recently announced their new Open Screen project, which opens the licensing of the Flash Player and much more.

We’re celebrating this event with a three part series on Dojo and ActionScript and previewing some of the work by the Dojo team.

(more…)

Porting Dojo Methods to Flash - Part 1 of 3 May 1st, 2008 at 8:57 am by Mike Wilcox

There’s been some breaking news from Adobe, announcing their Open Screen project. As of today, they are opening the licensing of the Flash Player, FLV/F4V video, publishing the AMF protocol and device APIs for the player, and more.

This is great news for businesses, developers, and the Open Web in general. No longer does open source ActionScript code need to do workarounds and leave things out in an effort to make it “as open as reasonably possible”.

In celebration of this announcement, we’re beginning our three part series on ActionScript code, and preview some of the Dojo team’s efforts in this area.

(more…)

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.