[I tried to send this to CF-Talk several times but it never seems to get
through... weird.  Anyway, here's a shot for Community.  We all know who's
cooler anyway.]

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




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

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

Reply via email to