Debug javascript with ease!

Discussion in 'Javascript' started by teppic.xxviii, Jun 21, 2007.

  1. Ok, so this is a little script that I've been working on and off for
    the past year or so, and finally I think it might be ready to be put
    to the ultimate test: other people!

    http://rdgreen.eu/js/debug.js

    It's basically a javascript file that can be used to help with the
    client-side debugging process.

    I use it like this: create a favelet called something like 'Debug
    Page' and put the following snip of code in it in place of the URL:

    javascript:(function(){var
    s=document.createElement('script');s.type='text/
    javascript';s.src='http://rdgreen.eu/js/
    debug.js';document.body.appendChild(s);})()

    Then whenever you get a problem, simply click the favelet and you can
    start inspecting the page you're working on.

    Read the comments at the top of the file for a full list of what you
    can do; but I think the best way is to just jump in and start snooping
    around.

    Run the favelet on this page, for example, then press the ` key (back-
    tick normally located under the escape key!) In the Evaluate textbox,
    type 'document', then press enter...

    When developing, simply dot Debug.Write's and Debug.InspectObject's
    throughout your code and this can help you track down almost any
    problem - it certainly works for me!

    Oh, one important note; I do realise there are plenty of debugging
    plug-ins and the like out there (such as the one for FireFox called
    FireBug, but this javascript file of mine works cross browser! Works
    in IE6, IE7, FireFox, Opera, maybe more!

    I hope someone out there will find some interest in this, it's been my
    baby for far too long and I think it's time I sent it out into the
    world on it's own!

    Enjoy,
    Richard
     
    teppic.xxviii, Jun 21, 2007
    #1
    1. Advertising

  2. teppic.xxviii

    Darko Guest

    On Jun 21, 3:46 pm, "teppic.xxviii" <>
    wrote:
    > Ok, so this is a little script that I've been working on and off for
    > the past year or so, and finally I think it might be ready to be put
    > to the ultimate test: other people!
    >
    > http://rdgreen.eu/js/debug.js
    >
    > It's basically a javascript file that can be used to help with the
    > client-side debugging process.
    >
    > I use it like this: create a favelet called something like 'Debug
    > Page' and put the following snip of code in it in place of the URL:
    >
    > javascript:(function(){var
    > s=document.createElement('script');s.type='text/
    > javascript';s.src='http://rdgreen.eu/js/
    > debug.js';document.body.appendChild(s);})()
    >
    > Then whenever you get a problem, simply click the favelet and you can
    > start inspecting the page you're working on.
    >
    > Read the comments at the top of the file for a full list of what you
    > can do; but I think the best way is to just jump in and start snooping
    > around.
    >
    > Run the favelet on this page, for example, then press the ` key (back-
    > tick normally located under the escape key!) In the Evaluate textbox,
    > type 'document', then press enter...
    >
    > When developing, simply dot Debug.Write's and Debug.InspectObject's
    > throughout your code and this can help you track down almost any
    > problem - it certainly works for me!
    >
    > Oh, one important note; I do realise there are plenty of debugging
    > plug-ins and the like out there (such as the one for FireFox called
    > FireBug, but this javascript file of mine works cross browser! Works
    > in IE6, IE7, FireFox, Opera, maybe more!
    >
    > I hope someone out there will find some interest in this, it's been my
    > baby for far too long and I think it's time I sent it out into the
    > world on it's own!
    >
    > Enjoy,
    > Richard


    I like it - it works well at the moment. Just one minor comment at the
    moment. If I inspect a variable (say ObjectPrinter) that's global, it
    shows all its properties just fine. But if I inspect the same variable
    again, it opens a new inspect-window - maybe it would be better just
    to refresh the existing window... I am not into how you've done it,
    and if that's possible based on your current solu+ion, but from user
    angle, it would be expected I think. Other from that, I think I'll
    myself find it pretty useful. Thanks! :)
     
    Darko, Jun 21, 2007
    #2
    1. Advertising

  3. teppic.xxviii

    -Lost Guest

    teppic.xxviii wrote:
    > Oh, one important note; I do realise there are plenty of debugging
    > plug-ins and the like out there (such as the one for FireFox called
    > FireBug, but this javascript file of mine works cross browser! Works
    > in IE6, IE7, FireFox, Opera, maybe more!


    And? So does Firebug.

    http://www.getfirebug.com/lite.html

    --
    -Lost
    Remove the extra words to reply by e-mail. Don't e-mail me. I am
    kidding. No I am not.
     
    -Lost, Jun 21, 2007
    #3
  4. teppic.xxviii

    -Lost Guest

    -Lost wrote:
    > teppic.xxviii wrote:
    >> Oh, one important note; I do realise there are plenty of debugging
    >> plug-ins and the like out there (such as the one for FireFox called
    >> FireBug, but this javascript file of mine works cross browser! Works
    >> in IE6, IE7, FireFox, Opera, maybe more!

    >
    > And? So does Firebug.
    >
    > http://www.getfirebug.com/lite.html


    Oh, and your site doesn't validate. *shrugs*

    --
    -Lost
    Remove the extra words to reply by e-mail. Don't e-mail me. I am
    kidding. No I am not.
     
    -Lost, Jun 21, 2007
    #4
  5. On Jun 21, 7:00 pm, Darko <> wrote:
    > On Jun 21, 3:46 pm, "teppic.xxviii" <>
    > wrote:
    >
    >
    >
    > > Ok, so this is a little script that I've been working on and off for
    > > the past year or so, and finally I think it might be ready to be put
    > > to the ultimate test: other people!

    >
    > >http://rdgreen.eu/js/debug.js

    >
    > > It's basically a javascript file that can be used to help with the
    > > client-side debugging process.

    >
    > > I use it like this: create a favelet called something like 'Debug
    > > Page' and put the following snip of code in it in place of the URL:

    >
    > > javascript:(function(){var
    > > s=document.createElement('script');s.type='text/
    > > javascript';s.src='http://rdgreen.eu/js/
    > > debug.js';document.body.appendChild(s);})()

    >
    > > Then whenever you get a problem, simply click the favelet and you can
    > > start inspecting the page you're working on.

    >
    > > Read the comments at the top of the file for a full list of what you
    > > can do; but I think the best way is to just jump in and start snooping
    > > around.

    >
    > > Run the favelet on this page, for example, then press the ` key (back-
    > > tick normally located under the escape key!) In the Evaluate textbox,
    > > type 'document', then press enter...

    >
    > > When developing, simply dot Debug.Write's and Debug.InspectObject's
    > > throughout your code and this can help you track down almost any
    > > problem - it certainly works for me!

    >
    > > Oh, one important note; I do realise there are plenty of debugging
    > > plug-ins and the like out there (such as the one for FireFox called
    > > FireBug, but this javascript file of mine works cross browser! Works
    > > in IE6, IE7, FireFox, Opera, maybe more!

    >
    > > I hope someone out there will find some interest in this, it's been my
    > > baby for far too long and I think it's time I sent it out into the
    > > world on it's own!

    >
    > > Enjoy,
    > > Richard

    >
    > I like it - it works well at the moment. Just one minor comment at the
    > moment. If I inspect a variable (say ObjectPrinter) that's global, it
    > shows all its properties just fine. But if I inspect the same variable
    > again, it opens a new inspect-window - maybe it would be better just
    > to refresh the existing window... I am not into how you've done it,
    > and if that's possible based on your current solu+ion, but from user
    > angle, it would be expected I think. Other from that, I think I'll
    > myself find it pretty useful. Thanks! :)


    The object inspecter windows have a little 'refresh' button :)
     
    teppic.xxviii, Jun 22, 2007
    #5
  6. On Jun 21, 11:18 pm, -Lost <> wrote:
    > -Lost wrote:
    > > teppic.xxviii wrote:
    > >> Oh, one important note; I do realise there are plenty of debugging
    > >> plug-ins and the like out there (such as the one for FireFox called
    > >> FireBug, but this javascript file of mine works cross browser! Works
    > >> in IE6, IE7, FireFox, Opera, maybe more!

    >
    > > And? So does Firebug.

    >
    > >http://www.getfirebug.com/lite.html

    >
    > Oh, and your site doesn't validate. *shrugs*
    >
    > --
    > -Lost
    > Remove the extra words to reply by e-mail. Don't e-mail me. I am
    > kidding. No I am not.


    Thank you for your helpful comments, but according to http://validator.w3.org/
    it does validate fine. Well apart from one page, but seriously.

    As for the firebug comment, thank-you for making that (sarcasm aside),
    I actually didn't know there was a lite version!
     
    teppic.xxviii, Jun 22, 2007
    #6
  7. teppic.xxviii

    -Lost Guest

    teppic.xxviii wrote:
    > On Jun 21, 11:18 pm, -Lost <> wrote:
    >> -Lost wrote:
    >>> teppic.xxviii wrote:
    >>>> Oh, one important note; I do realise there are plenty of debugging
    >>>> plug-ins and the like out there (such as the one for FireFox called
    >>>> FireBug, but this javascript file of mine works cross browser! Works
    >>>> in IE6, IE7, FireFox, Opera, maybe more!
    >>> And? So does Firebug.
    >>> http://www.getfirebug.com/lite.html

    >> Oh, and your site doesn't validate. *shrugs*
    >>

    >
    > Thank you for your helpful comments, but according to http://validator.w3.org/
    > it does validate fine. Well apart from one page, but seriously.


    All you did was reaffirm what I said.

    > As for the firebug comment, thank-you for making that (sarcasm aside),
    > I actually didn't know there was a lite version!


    My sarcasm was definitely much better than your claim, or should I go
    overboard and call you a liar?

    Anyway, I'm in a mood, so don't let my tone affect your good day
    (assuming you're having a good day). ;)

    --
    -Lost
    Remove the extra words to reply by e-mail. Don't e-mail me. I am
    kidding. No I am not.
     
    -Lost, Jun 22, 2007
    #7
  8. teppic.xxviii

    dd Guest

    On Jun 21, 3:46 pm, "teppic.xxviii" <>
    wrote:
    > Then whenever you get a problem, simply click the
    > favelet and you can start inspecting the page
    > you're working on.


    Sounds interesting. I can't get it to work
    on XP/IE7 or XP/FF2.0.0.4 :(

    I assume "favelet" is your made-up word for
    favorite/bookmark ?
     
    dd, Jun 23, 2007
    #8
  9. On Jun 23, 1:42 am, dd <> wrote:
    > On Jun 21, 3:46 pm, "teppic.xxviii" <>
    > wrote:
    >
    > > Then whenever you get a problem, simply click the
    > > favelet and you can start inspecting the page
    > > you're working on.

    >
    > Sounds interesting. I can't get it to work
    > on XP/IE7 or XP/FF2.0.0.4 :(
    >
    > I assume "favelet" is your made-up word for
    > favorite/bookmark ?


    Here is what a favelet is:

    http://www.google.com/search?client...=s&hl=en&q=define: favelet&btnG=Google Search

    The idea has been around for a few years and is pretty popular on FF/
    Safari.
     
    John Postlethwait, Jun 24, 2007
    #9
  10. teppic.xxviii

    dd Guest

    On Jun 24, 3:35 am, John Postlethwait <>
    wrote:
    > > I assume "favelet" is your made-up word for
    > > favorite/bookmark ?

    > Here is what a favelet is:
    > http://www.google.com/search?client=firefox-a&rls=org.mozilla:en-US...


    Thanks John. Weird, all this time I'd been
    using favorites/bookmarks to store JS that
    I wanted to execute via the address bar and
    I didn't realize it had a special name :)
     
    dd, Jun 24, 2007
    #10
  11. On Jun 22, 9:56 pm, -Lost <> wrote:
    > teppic.xxviii wrote:
    > > On Jun 21, 11:18 pm, -Lost <> wrote:
    > >> -Lost wrote:
    > >> Oh, and your site doesn't validate. *shrugs*

    >
    > > Thank you for your helpful comments, but according tohttp://validator.w3.org/
    > > it does validate fine. Well apart from one page, but seriously.

    >
    > All you did was reaffirm what I said.


    Thank you for pointing out the error of my ways; I have rectified the
    problem and will deign to never repeat this most heinous crime.

    > >>>> Oh, one important note; I do realise there are plenty of debugging
    > >>>> plug-ins and the like out there (such as the one for FireFox called
    > >>>> FireBug, but this javascript file of mine works cross browser! Works
    > >>>> in IE6, IE7, FireFox, Opera, maybe more!

    >
    > > As for the firebug comment, thank-you for making that (sarcasm aside),
    > > I actually didn't know there was a lite version!

    >
    > My sarcasm was definitely much better than your claim, or should I go
    > overboard and call you a liar?


    You could do that if you really wanted, however I personally consider
    what I said 'badly researched', for which I accept full liability and
    apologise sincerely for any harm or distress caused by my comments.
     
    teppic.xxviii, Jun 26, 2007
    #11
  12. On Jun 23, 9:42 am, dd <> wrote:
    > On Jun 21, 3:46 pm, "teppic.xxviii" <>
    > wrote:
    >
    > > Then whenever you get a problem, simply click the
    > > favelet and you can start inspecting the page
    > > you're working on.

    >
    > Sounds interesting. I can't get it to work
    > on XP/IE7 or XP/FF2.0.0.4 :(


    Hmm, the only thing I can think is that the keyboard hook-up isn't
    working. Perhaps it's something to do with the keyboard settings; I
    use a British keyboard set-up and I presume you're on US? Tried
    changing this on mine but it still works. Can you try creating a test
    html page, including the .js and then putting Debug.ShowWindow() in to
    the body onload?
     
    teppic.xxviii, Jun 26, 2007
    #12
  13. teppic.xxviii

    Guest

    On Jun 26, 10:12 am, "teppic.xxviii" <>
    wrote:
    > Hmm, the only thing I can think is that the
    > keyboard hook-up isn't working.
    > Can you try Debug.ShowWindow()


    I tried inserting that call at the end
    of the favelet. Now it auto-shows (which
    I think is a good default behaviour).

    Once it's shown, I can re-show using the
    keyboard ` character no problem. It's just
    the initial open that didn't work via the
    keyboard. Bizarre I know, but now I changed
    the favelet to auto-show, it's not an issue :)

    I think this will be very useful for the
    browsers that are determined to not be
    the least bit helpful (Safari !!).

    Cheers !!
     
    , Jun 26, 2007
    #13
  14. teppic.xxviii

    dd Guest

    On Jun 26, 10:12 am, "teppic.xxviii" <>
    wrote:
    > Hmm, the only thing I can think is that the
    > keyboard hook-up isn't working.
    > Can you try Debug.ShowWindow()


    I tried inserting that call at the end
    of the favelet. Now it auto-shows (which
    I think is a good default behaviour).

    Once it's shown, I can re-show using the
    keyboard ` character no problem. It's just
    the initial open that didn't work via the
    keyboard. Bizarre I know, but now I changed
    the favelet to auto-show, it's not an issue :)

    I think this will be very useful for the
    browsers that are determined to not be
    the least bit helpful (Safari !!).

    Cheers !!
     
    dd, Jun 26, 2007
    #14
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kelsey Bjarnason

    Ease of use...

    Kelsey Bjarnason, Jul 4, 2003, in forum: C Programming
    Replies:
    5
    Views:
    948
    Kelsey Bjarnason
    Jul 5, 2003
  2. Replies:
    1
    Views:
    319
    Edward Diener
    Apr 27, 2007
  3. bwv549
    Replies:
    4
    Views:
    188
    bwv549
    May 26, 2010
  4. gleery
    Replies:
    4
    Views:
    111
    Dr J R Stockton
    Jul 25, 2008
  5. mathog
    Replies:
    8
    Views:
    623
    Nobody
    May 5, 2012
Loading...

Share This Page