Skip to content

Recent Articles

13
Jun

Return JSON with PHP

When bringing Ajax technologies into your websites, it’s almost certain you’ll comes across the need to return data from the backend in a format that JavaScript works well with, such as JSON. With that, PHP is often a popular choice amongst developers for backend programming due to its wide adoption and low cost (FREE!). Thankfully PHP is actively developed and it supports many of todays web standards including JSON.
Read moreRead more

21
May

Decoupling Widget to Widget Interaction with Dojo

As a programmer, you should try to think of how you can write your code in a way that is maintainable and loosely coupled from other parts of your application. Loosely coupled basically means that you don’t tie down functionality and modules to be dependent on other parts of your application. In a way, you want to try and categorize the functionality and keep the functionality in one spot. Take our modern day telephone system for example. If you wanted to use your phone at home to call your friend on their phone on the other side of the world, the phones themselves don’t have to know each other. All they are concerned about is how to interact directly with the telephone system. The telephone system simply requires a telephone to know how to dial out and to be able to receive a phone call when the line is being rung.
Read moreRead more

20
Apr

Things about JavaScript I wish I knew earlier

Christian Hellman wrote another excellent JavaScript article over at Smashing Magazine. This time he addresses styles and techniques of coding that is widely supported, accepted, and expected by good JavaScript developers. If you’ve been programming JavaScript for awhile, you’ll notice much of the stuff is different now than it was less than a decade ago now that JavaScript has evolved and improved based on the  needs of the JavaScript community as well as the capabilities of modern-day browsers.
Read moreRead more

3
Feb

Cross-Domain Ajax with Dojo

If you are fairly new to JavaScript development or Ajax programming, you may not know that JavaScript has a limitation in which it cannot make a remote call to a service that is not on the same domain the script was called from. For instance, if I hosted a simple web service at kylehayes.info, I would not be able to access it from this site through the normal methods such as dojo.xhrGet() or dojo.xhrPost(). However, there are a couple of solutions to this issue. One of those is to consume web services that use a format called JSON-P (JSON with padding).
Read moreRead more

6
Jan

Source Code for Getting StartED with Dojo

Thanks to a reader for reaching out to me and pointing out that the source code is not posted on the Friends of ED site or this site for the book. I sincerely apologize for this inconvenience and mishap. For now, until it is posted on the publisher’s site, I have provided a link below that will allow you to download all the source code zipped up.

Source Code for Getting StartED with Dojo

Note, there is no source code in Chapter 3 and therefore you will not see a “ch03″ folder in the zip file that you download.

2
Jan

Simple Ajax Form Tutorial

Submitting an Ajax form using Dojo is very straightforward and simple. The main goal here is to simply send the values of a form to a backend script (whatever your preference, e.g. PHP or Python), without ever leaving the page. The page should also show a response to the user confirming that their request was sent successfully.

For starters, we need a simple HTML form that we are going to send. Construct this as you normally would with an id, action, and method values. In my example, I’ve created a basic contact form:
Read moreRead more

30
Dec

Getting StartED with Dojo now available!

Getting StartED with Dojo is finally available for purchase! About nine months ago I was approached by Apress to author a book on the Dojo toolkit. After a long journey of authoring my first book, the final phase is complete as the book is now officially published and out in the wild. While the actual publish date was December 28th, I’m sure it will be a little while before you start seeing it on the shelves of popular brick and mortar bookstore shelves such as Borders and Barnes & Noble. For now, you can certainly order it on Amazon.

Getting StartED with Dojo has fan page on Facebook:
Getting StartED with Dojo | Promote Your Page Too

You may also follow @startdojo on Twitter for up to date news and information relating to the Dojo toolkit and community.

I will mostly be using this site for updates to the book such as corrections to the code and copy. In addition, I will be posting tips and resources for learning more about the Dojo toolkit. A lot of work went into the creation of this book and I hope you enjoy it.

4
Nov

5 Easy Tutorials for Advanced JavaScript using Dojo

The Dojo Campus provides a wealth of documentation, tutorials for all levels, Dojo Cookies (like recipes), and demos of cool features.

Below are just a handful of tutorials that are available to beginners in Dojo that really help you get started.

  1. Dojo and Air, a fancy file uploader
    How many times have you had trouble uploading files to your favorite CMS? How many times did a client say “I am not happy with uploading one file at a time”? And last but not least, how many times did you implement a third party plugin/software/piece of magic to implement efficient file uploading?
    View tutorial >>
  2. Fancy Rounded Corners
    Make great looking rounded corners on your elements using only a single image.
    View tutorial >>
  3. Easily listen for events
    Custom events and Dom Events are all well and good for method-to-method functionality. It is a really common use case to connect some event happening to call another function, but when you get into really ambiguous, large applications, you need some mechanism to just say “hey, something has happened, act accordingly” … dojo.publish and dojo.subscribe provide just that mechanism.
    View tutorial >>
  4. Rounded tabs with themes
    Everybody likes rounded buttons, rounded page elements and last but not least, rounded tabs. Fortunately dijit comes with great theming possibilities, so I will show you how you can make your own fancy rounded tabs using a simple image sprite and a couple of CSS classes.
    View tutorial >>
  5. Separating Content from Presentation
    One of the cool things about Dojo is the dojo.xhrGet() function. It’s powerful because it makes transparent the browser dependent transports that make AJAX possible. In this cookie, we’re going to explore a simple use case in Dojo to separate content from the presentation of a page.
    View tutorial >>