轻松调试javascript! [英] Debug javascript with ease!

查看:70
本文介绍了轻松调试javascript!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,所以这是一个小脚本,我在过去一年左右的时间里一直在为
工作,最后我觉得它可能已经准备好了。 >
最终测试:其他人!

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


它基本上是一个javascript文件,可以用来帮助

客户端调试过程。


我这样使用它:创建一个名为''Debug

Page''的favelet并放入代码中包含以下代码片段:


javascript :( function(){var

s = document .createElement(''script''); s.type =''text /

javascript''; s.src =''http://rdgreen.eu/js/

debug.js''; document.body.appendChild(s);})()


然后,只要你遇到问题,只需点击favelet即可

开始检查页面你正在努力。


阅读文件顶部的评论,查看你b $ b可以做什么的完整清单;但我认为最好的方法就是跳入并开始窥探




例如,在此页面上运行favelet然后按` key(返回 -

tick通常位于转义键下!)在Evaluate文本框中,

键入''document'',然后按enter ...


在开发时,只需在代码中点上Debug.Write'和Debug.InspectObject'

,这可以帮助您追踪几乎所有

问题 - 它肯定对我有用!


哦,一个重要的注意事项;我确实意识到有很多调试

插件之类的东西(比如FireFox的一个名为

FireBug,但我的这个javascript文件交叉浏览器!在IE6,IE7,FireFox,Opera中工作

,或许更多!


我希望那里有人会对此感兴趣,它'''很长一段时间以来我一直是我的宝贝b $ b宝贝,我觉得是时候把它自己送到

世界了!


享受,

Richard

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

推荐答案

6月21日,3:下午46点,teppic.xxviii< teppic.xxv ... @ googlemail.com>

写道:
On Jun 21, 3:46 pm, "teppic.xxviii" <teppic.xxv...@googlemail.com>
wrote:

好​​的,所以这是一个小脚本,我在过去一年左右的时间里一直在努力工作,最后我觉得它可能已经准备就绪了。

最终测试:其他人!

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


它基本上是一个javascript文件,可用于帮助

客户端调试过程。


我这样使用它:创建一个名为''Debug

Page''的favelet并在其中放入以下代码片段代替URL:


javascript :( function(){var

s = document.createElement(''script''); s.type =''text /

javascript''; s.src =''http://rdgreen.eu/js/

debug.js''; document.body.appendChild(s);})()


然后,每当遇到问题时,只需单击favelet即可可以

开始检查您正在处理的页面。


阅读文件顶部的注释,获取您所用内容的完整列表/>
可以做;但我认为最好的方法就是跳入并开始窥探




例如,在此页面上运行favelet然后按` key(返回 -

tick通常位于转义键下!)在Evaluate文本框中,

键入''document'',然后按enter ...


在开发时,只需在代码中点上Debug.Write'和Debug.InspectObject'

,这可以帮助您追踪几乎所有

问题 - 它肯定对我有用!


哦,一个重要的注意事项;我确实意识到有很多调试

插件之类的东西(比如FireFox的一个名为

FireBug,但我的这个javascript文件交叉浏览器!在IE6,IE7,FireFox,Opera中工作

,或许更多!


我希望那里有人会对此感兴趣,它'''很长一段时间以来我一直是我的宝贝b $ b宝贝,我觉得是时候把它自己送到

世界了!


享受,

Richard
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



我喜欢它 - 它现在运作良好。只是一个小评论在

那一刻。如果我检查一个变量(比如说ObjectPrinter)那是'全局的那个,那么

显示它的所有属性就好了。但是如果我检查同一个变量
再次
,它会打开一个新的检查窗口 - 或许更好的只需要刷新现有的窗口... b $ b ...我不知道你是怎么做的它,

,如果这可能是基于你的电流t solu + ion,但是来自用户

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! :)


teppic.xxviii写道:
teppic.xxviii wrote:

哦,一个重要的注释;我确实意识到有很多调试

插件之类的东西(比如FireFox的一个名为

FireBug,但我的这个javascript文件交叉浏览器!在IE6,IE7,FireFox,Opera中运行

,或许更多!
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!



和?Firebug也是如此。

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


-

-Lost

删除多余的单词以通过电子邮件回复。不要发电子邮件我。开玩笑。我不是开玩笑。不,我不是。

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写道:
-Lost wrote:

teppic.xxviii写道:
teppic.xxviii wrote:

>哦,一个重要的注意事项;我确实意识到有很多调试
插件和喜欢在那里(比如FireFox的一个名为
FireBug,但我的这个javascript文件可以跨浏览器工作!工作
在IE6,IE7,FireF中牛,歌剧,也许更多!
>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!



和? Firebug也是如此。

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



哦,你的网站没有验证。 * shrugs *


-

-Lost

删除多余的单词以通过电子邮件回复。不要给我发电子邮件。我是开玩笑的。不,我不是。

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.


这篇关于轻松调试javascript!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆