在PHP项目中的netbeans 7.4中调试Javascript [英] Debug Javascript in netbeans 7.4 inside PHP project

查看:71
本文介绍了在PHP项目中的netbeans 7.4中调试Javascript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在netbeans的php项目中调试javascript代码.我已经阅读过几次,在新的netbeans 7.4版本中应该可以做到这一点,例如此处,但我无法使其正常工作.我已经为chrome安装了de debugger连接器,并且php调试工作正常,但是当我尝试在.js文件中设置断点时,它说:

I want to debug javascript code inside my php project in netbeans. I have read on several occasions that this should be possible in the new netbeans 7.4 version, for example here and here, but i cannot get it to work. I have installed de debugger connector for chrome and php debugging works just fine but when i try to set a breakpoint in a .js file it says:

未解决的断点,

unresolved breakpoint,

调试器未附加到ID为...的标签....

debugger is not attached to tab with id....

我知道netbeans页面上的链接适用于html 5应用程序,但是我认为在php项目中也将启用此调试功能.我做错什么了吗?

i understand that the link from the netbeans page is for an html 5 application but i thought this debugging would also be enabled in php projects. Am i doing something wrong?

我知道我可以使用firebug或chrome本身进行调试,但是我想在我的netbeans IDE中的一个地方完成所有操作...

i know i can debug with firebug or chrome itself but i would like to do it all in one place in my netbeans IDE...

预先感谢

推荐答案

未解决的断点通常意味着,例如,您将其设置为当前未加载到Chrome标签页中的文件中(或由于某些原因,IDE无法匹配以下URL) JS文件和本地JS文件).混合调试仅在Embdded Browser或带有NetBeans连接器的Chrome中有效(您可以在页面上看到通常显示为黄色的栏,上面写着"NetBeans连接器正在调试此页面",您可以同时调试PHP和JS.

The unresolved breakpoint usually mean that for instance you set it in file that is not loaded in Chrome's tab right now (or for some reason, IDE cannot match URL of JS file and local JS file). The mixed debugging works only in Embdded Browser or in Chrome with NetBeans connector (you can see the usually yellow bar in your page saying "NetBeans connector is debugging this page" and you can debug PHP and JS at the same time.

此处,尽管它与Java EE项目有关,但它非常类似于PHP项目

Have a look here, although it is about Java EE projects, it is very similar to PHP projects

更新后的答案:

我记得的一个问题(以及普通的Chrome开发工具也有)是,如果您将JavaScript文件附加到具有动态参数的HTML/PHP上,以防止浏览器进行缓存,例如,其中"673612"在每次加载文件时都会更改.如果是这种情况,请尝试删除此动态属性.我认为例如Sencha或ExtJS使用此功能破坏"调试器.

One issue I remember (and plain Chrome Dev Tools has it as well) is that if you have JavaScript file attached to HTML/PHP with dynamic parameter to prevent browser from caching, e.g. , where "673612" changes each time a file is loaded. If that's your case, try to remove this dynamic attribute. I think that e.g. Sencha or ExtJS use this feature which "breaks" debuggers.

这篇关于在PHP项目中的netbeans 7.4中调试Javascript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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