From: Ramon B. <ram...@f5...> - 2001-02-15 05:23:59
|
Hi I'm not too sure how people DEBUG javascript But I have found this very handy but I am sure your mileage may vary. It removes the need for using the 'alerts' left, right and everywhere The only drawback is before a refresh of the Calling page, you have to close this window also (maybe set an onReload .. (close DEBUG window) Anyways call it as such var DEBUG = 1 ... if (DEBUG) doDEBUG('layer1 has loaded') ---------------------------------- function doDEBUG (str) { if(!window.DEBUGWindow) { window.DEBUGWindow = window.open("", "DEBUG", "width=300, height=400"); // force the setting of the new windows parent if(!window.DEBUGWindow.opener) window.DEBUGWindow.opener = self window.DEBUGDynDoc = new DynDocument(window.DEBUGWindow) window.DEBUGDynDoc.setBgColor('#fff6f6') window.debugIT = new DynLayer() window.DEBUGDynDoc.addChild(window.debugIT) } window.debugIT.setHTML(window.debugIT.getHTML() + str + '<br>') window.debugIT.setSize(300,window.debugIT.getContentHeight()) } ---------------------------------- ------------------------------------------------ Ramon Buckland Applications Engineer email: ram...@f5... web: www.f5.com.au phone: (07) 3257 7900 fax: (07) 3257 7955 f5. Make the Medium Work. Simple. ------------------------------------------------ |
From: Michael P. <mp...@ph...> - 2001-02-15 11:52:56
|
I've got an alternative method that caches the errors until everything has loaded and generates a error output page. It can also be told to display javascript errors or even catch and not display javascript errors. DynAPI { errors : [], displayerrors : false, // indicates if you wish all errors to be caught or sent to the in-built js console errorHandler : function (msg, url, lno) { DynAPI.errors[DynAPI.errors.length] = [url,lno,msg]; // if the page has already loaded, errors will be alerted instead of sent to the debug page if (DynAPI.loaded&&DynAPI.displayerrors) alert("Error in '" + url + "'.\nLine number: " + lno + ".\nMessage: " + msg); return DynAPI.displayerrors; }, // The following line is added at the end of the loadHandler: if (DynAPI.errors.length&&DynAPI.displayerrors) DynAPI.errorOutput(); // The following line is added at the end of the dynapi.js onerror = DynAPI.errorHandler; -- Michael Pemberton mp...@ph... ICQ: 12107010 |
From: Jim F. <jf...@tm...> - 2001-02-15 15:29:42
|
I have been doing something very similar. I have thought about taking it to the next level and making it so that errorHandler actually sends the message (url,lno,msg) to me (the developer) via e-mail in the background, but returns true to the application so that the user is unaware that an error occurred. This way once the application is deployed I can keep a pulse on errors in the real world and take care of errors missed in the testing, yet the user is not hindered since all of this notification happens in the background. Any thoughts on implementation? Jim ----- Original Message ----- From: "Michael Pemberton" <mp...@ph...> To: <dyn...@li...> Sent: Wednesday, February 14, 2001 11:21 PM Subject: Re: [Dynapi-Dev] A handy DEBUG method > I've got an alternative method that caches the errors until everything has > loaded and generates a error output page. It can also be told to display > javascript errors or even catch and not display javascript errors. > > DynAPI { > errors : [], > displayerrors : false, // indicates if you wish all errors to be caught or > sent to the in-built js console > errorHandler : function (msg, url, lno) { > DynAPI.errors[DynAPI.errors.length] = [url,lno,msg]; > // if the page has already loaded, errors will be alerted instead of > sent to the debug page > if (DynAPI.loaded&&DynAPI.displayerrors) > alert("Error in '" + url + "'.\nLine number: " + lno + > ".\nMessage: " + msg); > return DynAPI.displayerrors; > }, > > // The following line is added at the end of the loadHandler: > if (DynAPI.errors.length&&DynAPI.displayerrors) DynAPI.errorOutput(); > > // The following line is added at the end of the dynapi.js > onerror = DynAPI.errorHandler; > > -- > Michael Pemberton > mp...@ph... > ICQ: 12107010 > > > > > > > _______________________________________________ > Dynapi-Dev mailing list > Dyn...@li... > http://lists.sourceforge.net/lists/listinfo/dynapi-dev > |
From: Richard B. <ma...@ri...> - 2001-02-15 15:48:05
|
AFAIK it only works with server side technology, and you would have to tell the user this happens, or they'd think it's spy-ware. Apart from that I think I would implement it on my site, saving results to a database, including the users browser and platform. Cheers, Richard Bennett ma...@ri... www.richardinfo.com (Everything running on, and ported to the 19/12/2000 snapshot of DynAPI2) Find the DynAPI faq here: http://sourceforge.net/docman/display_doc.php?docid=656&group_id=5757 Browse the mailinglist here: http://www.mail-archive.com/index.php3?hunt=dynapi ----- Original Message ----- From: "Jim Foster" <jf...@tm...> To: <dyn...@li...> Sent: Thursday, February 15, 2001 4:30 PM Subject: Re: [Dynapi-Dev] A handy DEBUG method > I have been doing something very similar. I have thought about taking it to > the next level and making it so that errorHandler actually sends the message > (url,lno,msg) to me (the developer) via e-mail in the background, but > returns true to the application so that the user is unaware that an error > occurred. This way once the application is deployed I can keep a pulse on > errors in the real world and take care of errors missed in the testing, yet > the user is not hindered since all of this notification happens in the > background. > > Any thoughts on implementation? > > Jim > > > ----- Original Message ----- > From: "Michael Pemberton" <mp...@ph...> > To: <dyn...@li...> > Sent: Wednesday, February 14, 2001 11:21 PM > Subject: Re: [Dynapi-Dev] A handy DEBUG method > > > > I've got an alternative method that caches the errors until everything has > > loaded and generates a error output page. It can also be told to display > > javascript errors or even catch and not display javascript errors. > > > > DynAPI { > > errors : [], > > displayerrors : false, // indicates if you wish all errors to be > caught or > > sent to the in-built js console > > errorHandler : function (msg, url, lno) { > > DynAPI.errors[DynAPI.errors.length] = [url,lno,msg]; > > // if the page has already loaded, errors will be alerted instead > of > > sent to the debug page > > if (DynAPI.loaded&&DynAPI.displayerrors) > > alert("Error in '" + url + "'.\nLine number: " + lno + > > ".\nMessage: " + msg); > > return DynAPI.displayerrors; > > }, > > > > // The following line is added at the end of the loadHandler: > > if (DynAPI.errors.length&&DynAPI.displayerrors) DynAPI.errorOutput(); > > > > // The following line is added at the end of the dynapi.js > > onerror = DynAPI.errorHandler; > > > > -- > > Michael Pemberton > > mp...@ph... > > ICQ: 12107010 > > > > > > > > > > > > > > _______________________________________________ > > Dynapi-Dev mailing list > > Dyn...@li... > > http://lists.sourceforge.net/lists/listinfo/dynapi-dev > > > > > _______________________________________________ > Dynapi-Dev mailing list > Dyn...@li... > http://lists.sourceforge.net/lists/listinfo/dynapi-dev > ____________________________________________________________ > Get your free domain name and domain-based e-mail from > Namezero.com. New! Namezero Plus domains now available. > Find out more at: http://www.namezero.com > |
From: Doug M. <do...@cr...> - 2001-02-15 16:34:09
|
very good idea.. There are only two ways to go about it tho (That I know of), one would be a dialog "Do you wish to send a debug report?" if they answer yes, then bring up their email client (mailto:ar...@ar...) OR you would have to use a server side component of some sort.. I have an 'email us' form on some of my client site which use IIS and ASP to send the message via the server: The following code is the asp (server side) code to send an email. Note: You need to have SMTP installed on the NT/win2k server. <% Dim MyMail Set MyMail = Server.CreateObject("CDONTS.NewMail") MyMail.From = de...@de... MyMail.To = ar...@ar... MyMail.Subject = "an error report" MyMail.BodyFormat = 1 'text? MyMail.MailFormat = 1 MyMail.Body = "Error message..." MyMail.Send Set MyMail = Nothing response.redirect("thankyou_home.html") %> ----- Original Message ----- From: "Jim Foster" <jf...@tm...> To: <dyn...@li...> Sent: Thursday, February 15, 2001 7:30 AM Subject: Re: [Dynapi-Dev] A handy DEBUG method > I have been doing something very similar. I have thought about taking it to > the next level and making it so that errorHandler actually sends the message > (url,lno,msg) to me (the developer) via e-mail in the background, but > returns true to the application so that the user is unaware that an error > occurred. This way once the application is deployed I can keep a pulse on > errors in the real world and take care of errors missed in the testing, yet > the user is not hindered since all of this notification happens in the > background. > > Any thoughts on implementation? > > Jim > > > ----- Original Message ----- > From: "Michael Pemberton" <mp...@ph...> > To: <dyn...@li...> > Sent: Wednesday, February 14, 2001 11:21 PM > Subject: Re: [Dynapi-Dev] A handy DEBUG method > > > > I've got an alternative method that caches the errors until everything has > > loaded and generates a error output page. It can also be told to display > > javascript errors or even catch and not display javascript errors. > > > > DynAPI { > > errors : [], > > displayerrors : false, // indicates if you wish all errors to be > caught or > > sent to the in-built js console > > errorHandler : function (msg, url, lno) { > > DynAPI.errors[DynAPI.errors.length] = [url,lno,msg]; > > // if the page has already loaded, errors will be alerted instead > of > > sent to the debug page > > if (DynAPI.loaded&&DynAPI.displayerrors) > > alert("Error in '" + url + "'.\nLine number: " + lno + > > ".\nMessage: " + msg); > > return DynAPI.displayerrors; > > }, > > > > // The following line is added at the end of the loadHandler: > > if (DynAPI.errors.length&&DynAPI.displayerrors) DynAPI.errorOutput(); > > > > // The following line is added at the end of the dynapi.js > > onerror = DynAPI.errorHandler; > > > > -- > > Michael Pemberton > > mp...@ph... > > ICQ: 12107010 > > > > > > > > > > > > > > _______________________________________________ > > Dynapi-Dev mailing list > > Dyn...@li... > > http://lists.sourceforge.net/lists/listinfo/dynapi-dev > > > > > _______________________________________________ > Dynapi-Dev mailing list > Dyn...@li... > http://lists.sourceforge.net/lists/listinfo/dynapi-dev --- Outgoing mail is certified Virus Free by AVG Free Edition http://www.grisoft.com/html/us_index.cfm Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.231 / Virus Database: 112 - Release Date: 2/12/01 |
From: Doug M. <do...@cr...> - 2001-02-15 16:26:55
|
sweet ----- Original Message ----- From: "Michael Pemberton" <mp...@ph...> To: <dyn...@li...> Sent: Wednesday, February 14, 2001 10:21 PM Subject: Re: [Dynapi-Dev] A handy DEBUG method > I've got an alternative method that caches the errors until everything has > loaded and generates a error output page. It can also be told to display > javascript errors or even catch and not display javascript errors. > > DynAPI { > errors : [], > displayerrors : false, // indicates if you wish all errors to be caught or > sent to the in-built js console > errorHandler : function (msg, url, lno) { > DynAPI.errors[DynAPI.errors.length] = [url,lno,msg]; > // if the page has already loaded, errors will be alerted instead of > sent to the debug page > if (DynAPI.loaded&&DynAPI.displayerrors) > alert("Error in '" + url + "'.\nLine number: " + lno + > ".\nMessage: " + msg); > return DynAPI.displayerrors; > }, > > // The following line is added at the end of the loadHandler: > if (DynAPI.errors.length&&DynAPI.displayerrors) DynAPI.errorOutput(); > > // The following line is added at the end of the dynapi.js > onerror = DynAPI.errorHandler; > > -- > Michael Pemberton > mp...@ph... > ICQ: 12107010 > > > > > > > _______________________________________________ > Dynapi-Dev mailing list > Dyn...@li... > http://lists.sourceforge.net/lists/listinfo/dynapi-dev > --- Outgoing mail is certified Virus Free by AVG Free Edition http://www.grisoft.com/html/us_index.cfm Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.231 / Virus Database: 112 - Release Date: 2/12/01 |