我如何获得Firebug的直通式内嵌JavaScript代码? [英] How can I get Firebug to step-through inline javascript code?

查看:142
本文介绍了我如何获得Firebug的直通式内嵌JavaScript代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我的javascript代码包含在我的HTML文件的HEAD块中时,似乎我无法在其上设置断点来调试它。



如何能我这样做?



alt text http://www.deviantsart .com / upload / mhmbha.png



这是我在脚本标记下看到的:



alt text http://www.deviantsart.com/upload/17g116c.png



替代文字http://www.deviantsart.com/upload/irki5p.png



alt text http://www.deviantsart。 com / upload / mts9hn.png



奇怪的是:当我把HTML块的HTML块放到$ < head> ; 区域,那么.htm页面出现在脚本下(反作用):

替代文字http://www.deviantsart.com/upload/5rfia.png



好吧,唯一的解决方案我可以找到这个问题是把我的HEAD脚本回到一个.js文件,任何人都有一种方法来调试内联的JavaScript?

解决方案

我发现这个问题。



而不是:

 < $(this).next()。(':hidden')){


$ b $ ($:this).next()。is(':hidden'){b $ p

$ $ $ $

即缺少的结束括号导致javascript文件(或包含javascript的.htm页面)不会显示在firebugscripts下。


When my javascript code is contained in a HEAD block in my HTML file, it seems I can't set a breakpoint on it to debug it.

How can I do this?

alt text http://www.deviantsart.com/upload/mhmbha.png

this is what I see under the script tag:

alt text http://www.deviantsart.com/upload/17g116c.png

alt text http://www.deviantsart.com/upload/irki5p.png

alt text http://www.deviantsart.com/upload/mts9hn.png

Odd: when I take the javascript block OUT of my HTML <head> area, then the .htm page appears under scripts (kind of counter-productive):

alt text http://www.deviantsart.com/upload/5rfia.png

ok, the only solution I can find to this question is to put my HEAD scripts back into a .js file, anyone have a way to debug inline javascript?

解决方案

I found the problem.

instead of:

if($(this).next().is(':hidden')) { 

I had:

if($(this).next().is(':hidden') { 

i.e. the missing end-parenthesis was causing the javascript file (or .htm page including the javascript) not to show up under firebug "scripts".

这篇关于我如何获得Firebug的直通式内嵌JavaScript代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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