i've been using a js-console for a while and
found it useful so i thought i'll ported it to DynAPI
and share it with you.

with the console you get a small popup-window
to which you are able to write variables, messages
and so on. very usefull instead of those alert's

put the console.js in dynapi/util/ 

methods: 

DynAPI.console.open()
opens the console-window

DynAPI.console.write(msg)
writes msg to the console
if the console isn't opened, this will be done for you.
internet explorer will also scroll to the bottom of the console 
where the newest messages are, couldn't found out how
you do this in netscape

DynAPI.console.close()
closes the console-window

DynAPI.console.enable()
enables the console

DynAPI.console.disable()
disables the console (the console wont open or be written to)

DynAPI.console.clear()
clears the console window


example:

DynAPI.setLibraryPath('dynapi/src/lib')
DynAPI.include('dynapi.api.*')
DynAPI.include('dynapi.util.console')

DynAPI.onLoad=function() {
    layer = new DynLayer(null,40,10,25,50,'red');
    DynAPI.document.addChild(layer);

    DynAPI.console.write(layer.toString());
    DynAPI.console.write('position: '+layer.x+'x'+layer.y);
    DynAPI.console.write('size: '+layer.w+'x'+layer.h);
};

(leave the console open when you reload the
page, then the console-window's position and
size will remain)

cheers
/martin

Console.zip

Reply via email to