Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New to the CF scene
    Join Date
    Jan 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Sending output to JavaScript console?

    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!

  • #2
    teh Moderatorinator
    Join Date
    Sep 2004
    Location
    USA
    Posts
    2,472
    Thanks
    4
    Thanked 40 Times in 40 Posts
    The javascript console is used for debuging...why would you need to write to it?

  • #3
    Senior Coder
    Join Date
    Feb 2004
    Location
    Edinburgh
    Posts
    1,352
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.
    *keep it simple (TM)

  • #4
    New to the CF scene
    Join Date
    Jan 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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/~...zForWebDev.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?

  • #5
    Senior Coder
    Join Date
    Feb 2004
    Location
    Edinburgh
    Posts
    1,352
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by jgarbers
    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.
    *keep it simple (TM)

  • #6
    New to the CF scene
    Join Date
    Jan 2005
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cool all you gotto do is...

    start firefox using the command "firefox -console". Thasit!

  • #7
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,037
    Thanks
    0
    Thanked 250 Times in 246 Posts


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •