Not specifically CF related, but definitely related to CF... if you get my
meaning.  ;^)

I've spent some time and created a library which extends JavaScript objects
with several new methods.  Here's a page I quickly shot out offering some
basic documentation and an example of the debugging.

http://www.depressedpress.com/depressedpress/test/

The code is VERY beta and not complete, but everything I show in my examples
works (at least in the latest IE and FireFox).

If you have the time and the inclination I'd love some feedback and
suggestions.

The most useful new feature (I think) is the "dpDump" method.  Using this
you can dump an html representation (not wholly unlike CFDUMP's output) of a
JavaScript object to a debugging window.

If you've ever wished for CFDUMP while working in JavaScript (like I have)
this should make you happy.  ;^)

While doing that it became clear that other serializations would be
relatively easy (since getting to HTML is really a serialization) so I also
exposed the "dpSerialize" and "doDeserialize" methods.

Right now the only thing works is JSON serialization (using a custom engine)
and Deserialization (although this is, currently, "cheap" - all I'm doing is
eval()).

These methods are available from any JS object (objects, arrays, dates, etc)
as a local method.  For example:

MyObject = new Object;
MyObject.prop1 = "val1";
MyObject.prop2 = "val2";
MyObject.dpDump();

Will dump that object to a debugging window.

To get the JSON representation of that object you just do:

MyObject.dpSerialize("JSON");

The idea is to eventually provide many of the more tedious requirement for
WebService/AJAX development as direct methods from the objects.

Jim Davis




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:214941
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to