473,471 Members | 1,778 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Debug javascript with ease!

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

Jun 21 '07 #1
15 1815
On Jun 21, 3:46 pm, "teppic.xxviii" <teppic.xxv...@googlemail.com>
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! :)
Jun 21 '07 #2
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.
Jun 21 '07 #3
-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.
Jun 21 '07 #4
On Jun 21, 7:00 pm, Darko <darko.maksimo...@gmail.comwrote:
On Jun 21, 3:46 pm, "teppic.xxviii" <teppic.xxv...@googlemail.com>
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 :-)

Jun 22 '07 #5
On Jun 21, 11:18 pm, -Lost <maventheextrawo...@techie.comwrote:
-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!

Jun 22 '07 #6
teppic.xxviii wrote:
On Jun 21, 11:18 pm, -Lost <maventheextrawo...@techie.comwrote:
>-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.
Jun 22 '07 #7
dd
On Jun 21, 3:46 pm, "teppic.xxviii" <teppic.xxv...@googlemail.com>
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 ?

Jun 23 '07 #8
On Jun 23, 1:42 am, dd <dd4...@gmail.comwrote:
On Jun 21, 3:46 pm, "teppic.xxviii" <teppic.xxv...@googlemail.com>
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=...=Google+Search

The idea has been around for a few years and is pretty popular on FF/
Safari.

Jun 24 '07 #9
dd
On Jun 24, 3:35 am, John Postlethwait <john.postlethw...@gmail.com>
wrote:
I assume "favelet" is your made-up word for
favorite/bookmark ?
Here is what a favelet is:
http://www.google.com/search?client=...ozilla%3Aen-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 :-)

Jun 24 '07 #10
On Jun 22, 9:56 pm, -Lost <maventheextrawo...@techie.comwrote:
teppic.xxviii wrote:
On Jun 21, 11:18 pm, -Lost <maventheextrawo...@techie.comwrote:
-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.

Jun 26 '07 #11
On Jun 23, 9:42 am, dd <dd4...@gmail.comwrote:
On Jun 21, 3:46 pm, "teppic.xxviii" <teppic.xxv...@googlemail.com>
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?

Jun 26 '07 #12
On Jun 26, 10:12 am, "teppic.xxviii" <teppic.xxv...@googlemail.com>
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 '07 #13
dd
On Jun 26, 10:12 am, "teppic.xxviii" <teppic.xxv...@googlemail.com>
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 '07 #14
teppic.xxviii wrote:
On Jun 22, 9:56 pm, -Lost <maventheextrawo...@techie.comwrote:
>teppic.xxviii wrote:
>>On Jun 21, 11:18 pm, -Lost <maventheextrawo...@techie.comwrote:
-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.
Um, you missed entirely where I said ignore my moody reply, but thanks
for the civility nonetheless! :)

--
-Lost
Remove the extra words to reply by e-mail. Don't e-mail me. I am
kidding. No I am not.
Jun 27 '07 #15
teppic.xxviii wrote:
On Jun 23, 9:42 am, dd <dd4...@gmail.comwrote:
>On Jun 21, 3:46 pm, "teppic.xxviii" <teppic.xxv...@googlemail.com>
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?
I don't know if this helps at all, but I have (in Firefox)
accessibility.typeaheadfind and accessibility.typeaheadfind.auto all set
to true. So these applications that attempt to take over my normal
keyboard functions usually fail in this regard.

Whereas an application says "Hit D to go Down, and U for Up", my browser
is actually searching for D, then U.

Not sure if that helps at all, just something I thought about when you
said "keyboard hook-up isn't working."

--
-Lost
Remove the extra words to reply by e-mail. Don't e-mail me. I am
kidding. No I am not.
Jun 27 '07 #16

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Robert | last post by:
Simple way of writing debug print statements in your JavaScript code. You need to have enabled popups in your browser. I liked the ability to write to the java console in Netscape 4.x. This,...
2
by: apngss | last post by:
Is there any way to debug javascript in a web application? When I develop JSP pages, and it has the javascript code in it. The problem is the debugger in Java IDE (WSAD in my case) can only debug...
1
by: yma | last post by:
Hi, I have an asp.net app that I uses javascript in the html file. Can you show me how to debug javascript in vb.net. I use vb.net in vs.net. Here is a sample html file. If I cannot use...
4
by: TARUN | last post by:
Hello all I am new to web technology, so plz excuse me for posting such a silly question . I have a code in C#.NET , ASP.NET, Javascript . I am a begginer of Javascript i don't understand...
2
by: Dinh Bao Tuyen | last post by:
Hi everyone, I can't debug javascript in VS 2005. In my VS2005, I can't find Script Explorer in menu. Can u help me???
13
by: CptDondo | last post by:
I am trying to improve the performance of an embedded app that uses javascript. Our javascript functions are quite long, and (for ease of maintenance) quite verbose. We already do things like...
9
by: Bern McCarty | last post by:
I am porting stuff from MEC++ syntax to the new C++/CLI syntax. Something that we did in the old syntax that proved to be very valuable was to make sure that the finalizer would purposefully...
34
by: dhtml | last post by:
I made a change to the FAQ of javascript to EcmaScript. I got some feedback that the newsgroup is CLJ and the language is commonly referred to as JavaScript. Therefore, the word in the FAQ...
2
by: joelkeepup | last post by:
Hi, I made a change this morning and now im getting an error that says either "a is undefined or null" or "e is undefined or null" the microsoft ajax line is below, I have no idea how to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.