View Full Version : Sending output to JavaScript console?
jgarbers
01-06-2005, 07:28 PM
For debugging purposes, I'd like to be able to send output to Firefox's JavaScript console from JavaScript. The only code I've found to do this is used inside extensions, and doesn't appear to work within a regular page. Maybe I'm missing something obvious (as a JS newbie), but does anybody know if it's possible to send output to that console? If not, what do you use for tracing and debugging? I'm looking for something simple that doesn't interfere with the page being displayed; Venkman is a bit beyond me at this point. Thanks!
Brandoe85
01-06-2005, 08:48 PM
The javascript console is used for debuging...why would you need to write to it?
if you wanna debug, then for FF use window.dump, I think.
or else, create your own popup that you write to whenever the main window encounters an error.
jgarbers
01-06-2005, 09:51 PM
The javascript console is used for debuging...why would you need to write to it?
well... for debugging, like I said. :) For example, I might want to see the value of a variable or log some event without interfering with the layout of the page or making an alert() appear.
A nice writeup on some JavaScript debugging options is at http://www.student.cs.uwaterloo.ca/~j4lui/mozForWebDev.xml - I tried the solutions with setting browser.dom.window.dump.enabled but neither window.dump("msg") nor dump("msg") gave any results. I may try the other "probably not worth it" method just to see if I can get it to work.
What other tracing / debugging methods are people with more experience at this than me using?
What other tracing / debugging methods are people with more experience at this than me using?
For FF, Venkman is the best. And IE has it's own debugger (providing it's installed on the system, i believe).
but as i said, you can always code your own popup window. saw something similar for the DynAPI library some time ago.
glnsagar
01-14-2005, 12:44 AM
start firefox using the command "firefox -console". Thasit!
glenngv
01-14-2005, 05:25 AM
JS FAQ #1 (http://www.codingforums.com/showthread.php?p=178016#post178016)
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.