[webmap-discuss] Javascript debug libraries?

Paul Spencer pspencer at dmsolutions.ca
Sun Aug 27 22:31:20 EDT 2006


Conveniently, Safari will respect console.log() calls as well,  
dumping the output into the javascript console.

Inconveniently, IE doesn't.  I use the following to map console.log  
in IE after the onload event and use #console in CSS to show/hide and  
style the div

//IE compatibility for logging stuff
if (typeof console == 'undefined' || !console) {
     console = document.createElement('div');
     console.id = 'console';
     console.log = function(s) {this.innerHTML = s+"<BR>" +  
this.innerHTML};
     document.body.appendChild(console);
}

Cheers

Paul

On 26-Aug-06, at 6:02 PM, Christopher Schmidt wrote:

> On Sun, Aug 27, 2006 at 07:53:47AM +1000, Cameron Shorter wrote:
>> Mapbuilder uses alert() calls for our debugging and I'm looking to  
>> write
>> a widget which can display a debug string or XML document.
>>
>> What do the other JS GIS projects use for debugging?
>> Is there a JS debugging package you'd recommend?
>
> Get Firefox. Use FireBug. (https://addons.mozilla.org/firefox/1843/)
>
> console.log() goes to a console in the browser, you can see
> XMLHttpRequest, you get a full debugger, source and object inspector,
> and more.
>
> So, console.log(map) will print "[object Object]", which is  
> clickable to
> see all the properties of Object.
>
> It's super-good.
>
> -- 
> Christopher Schmidt
> Web Developer
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webmap-discuss-unsubscribe at mail.osgeo.org
> For additional commands, e-mail: webmap-discuss-help at mail.osgeo.org
>

+-----------------------------------------------------------------+
|Paul Spencer                           pspencer at dmsolutions.ca   |
+-----------------------------------------------------------------+
|Applications & Software Development                              |
|DM Solutions Group Inc                 http://www.dmsolutions.ca/|
+-----------------------------------------------------------------+








More information about the Mail_webmap-discuss mailing list