Well, this is my first attemp to contribute to this proyect. I have
modified de error handling code to allow switching on/off the error
messages. I dunno if someone has done this yet, but I use it when
testing my apps so I thought it might be useful. Here's it:

function DebugObj() {}
DebugObj.prototype.on = function() {
 onerror = function(msg,url,lno) {
  if (is.ie) alert("Error reported!\n\nProyect: '"+url+"'\nLine:
"+(lno-1)+"\nError: ["+msg+"]");
  else if (is.ns4) alert("Error reported!\n\nFile:
'"+url.substr(url.lastIndexOf('/')+1)+"'\nLine: "+lno+"\nError:
["+msg+"]");
  else return false;
  return true;
 }
}
DebugObj.prototype.off = function() {
 onerror = function() {
  onerror = null;
  return true;
 }
}
var DEBUG = new DebugObj();
DEBUG.off(); //switch off by default


Any comments?

__________________________________________________
Do You Yahoo!?
Check out Yahoo! Shopping and Yahoo! Auctions for all of
your unique holiday gifts! Buy at http://shopping.yahoo.com
or bid at http://auctions.yahoo.com

_______________________________________________
Dynapi-Dev mailing list
[EMAIL PROTECTED]
http://www.mail-archive.com/dynapi-dev@lists.sourceforge.net/

Reply via email to