Archive for the 'AJAX' Category

FlashAJAXBridge API

Friday, May 26th, 2006

I programmed an API which allows interoperability between AJAX, Flash 8 and Flex 1.5. The FlashAJAXBridge API consists of a few simple ActionScript 2.0 methods which allow you to call javascript methods that target document elements and reset their dataProviders. The API also can invoke calls to an instance of the XMLHTTPRequest object which makes discreet calls to the server for loading external xml documents.

I made a simple example that demonstrates the methods that are available for registering javascript functions which can be invoked in Flash or Flex. A cool little extra that I added is the FlashObject instance is set using attributes from an xml-config document to embed the swf. The config document also specifies which div element to write the FlashObject to.

You can view an example of the API by clicking on the link below:
FlashAJAXBridge.html

AJAX Debugger beta 2.0

Monday, May 22nd, 2006

This weekend I built an AJAX debugger which for handling complex types such as objects, arrays, JSON objects etc. The AJAXDebugger traces out all members of a user defined objects, properties of an object, indexes of an array, keys of an array or other object types to a div tag with an id of “console” in your application.
To use it, just include the debugger.js file and create a div somewhere on the page to use as an output panel. Give the div tag an id of “console” as follows:

To use the debugger simply use the following syntax to trace an object to the console div:

Example:
trace (object, true) - whereas the first param is an object of any type to trace and the second param instructs the debugger to recursively trace out the object or not.

Usage Example:
var obj = new Object();
this.obj.name = “AJAX Debugger”;
this.obj.build = 1.0;
this.trace(obj, true);

Outputs the following to the “console” div:
Found instance of type : Object
.name = AJAX Debugger
.build = 1

An upgrade to verison 2.0 will be made within the next few weeks which will allow the console to be in a seperate window abstracted from the application itself.

To view an example of how the debugger works click on the link below:
AJAXDebugger-v1.0/debugger.html

To download version 1.0 of the AJAX Debugger click on the link below:
http://www.ericfeminella.com/utilities/AJAXDebugger.zip

Feel free to email me with your thoughts on the Debugger.

Adobe Spry - Prerelease 1

Thursday, May 18th, 2006

I have been building basic applications in AJAX for awhile now. I definetely enjoy AJAX just as I enjoy any cool new technology. Adobe has released the Spry Framework for AJAX which is a step in the right direction. A friend of mine at work also developed an AJAX MVC which will be available on sourceforge soon. The AJAX MVC is based on a framework which is configured simular to struts MVC in Java. I’ll have a link as soon as it is available.

My biggest complaint about AJAX is that there is no proper implementation for class based development beyond the use of prototype classes, which is a very far cry from standard object oriented languages that implement the ECMA standard such as Java, C# and ActionScript 2.0 and 3.0. Below is a brief breakdown of the Spry Framework for anyone who is interested. If you are constrained to html based applications whereas the use of Flash Player or proprietary frameworks are not an option, then AJAX is definetely your best choice.

The Spry framework for Ajax is a JavaScript library for web designers that provides functionality that allows designers to build pages that provide a richer experience for their users. It is designed to bring Ajax to the web design community who can benefit from Ajax, but are not well served by other frameworks. The first release of the Spry framework is a preview of the data capabilities that enable designers to incorporate XML data into their HTML documents using HTML, CSS, and a minimal amount of JavaScript, without the need for refreshing the entire page. The Spry framework is HTML-centric, and easy to implement for users with basic knowledge of HTML, CSS and JavaScript. The framework was designed such that the markup is simple and the JavaScript is minimal. The Spry framework can be used by anyone who is authoring for the web in their tool of choice.

http://labs.adobe.com/technologies/spry/

AJAX Desktop:: beta 1

Friday, April 21st, 2006

I used to build lots of .swf’s embedded in html pages and set the html page as my desktop as oppossed to just having an image set as my desktop. This was cool because the swf would read from an xml file and add links that I can access directly from my desktop. I also had various effects and what not as well as news aggregators, clocks and an mp3 player. The only problem that I couldn’t seem to solve is that when I would try to make a selection on my desktop focus was on the .swf and not the desktop. So this was a problem.

My solution was to do the same exact thing but in AJAX rather than flash this way focus would remain on the desktop. Below is a link to the working sample as well as a link to the source files for you to use as you wish. Simply add all of your favorite images in the images folder and then modify the ajax-desktop.js file and add your images as indexes of the ‘imagesArray’. Everytime you boot up you will have a different image load randomly as your desktop. You can add links to your executables allowing you to rid yourself of desktop icons as well as links to your favorite sites.

Sample:
ajax-desktop.html

Download Source code:
ajax-desktop.zip