admin管理员组文章数量:1405375
In my first steps, I'm using this not rational way, as described below:
- Create an HTML5 project to debug the JavaScript code.
- Create the definitive PHP project, with JS code already tested, where I debug the server side.
So I'm wondering if there is a smarter way of doing this?
E.g.: create a unique project and switch between native NetBeans JavaScript debugger and the (PHP) XDebug.
In my first steps, I'm using this not rational way, as described below:
- Create an HTML5 project to debug the JavaScript code.
- Create the definitive PHP project, with JS code already tested, where I debug the server side.
So I'm wondering if there is a smarter way of doing this?
E.g.: create a unique project and switch between native NetBeans JavaScript debugger and the (PHP) XDebug.
- 1 Why aren't you debugging the JavaScript in the browser? – Matt Ball Commented Apr 4, 2013 at 2:25
-
1
Agree with @MattBall: you should be debugging JavaScript in the browser. You can use
Firebug
on Firefox orChrome Developer Tools
in Google Chrome – juan.obando Commented Apr 4, 2013 at 2:32 - @MattBall, for laziness reasons... of ing back to NetBeans and edit the code, but it is the best way. Thanks for remember. – ajmacedo Commented Apr 4, 2013 at 3:26
- 1 @MattBall: it can be more fortable to debug AND modify (!) JavaScript code in NetBeans or another favourite IDE of yours. If you are used to write and debug codes in the IDE you configured to your taste (hotkeys, panels, etc.), why not using it? – Sk8erPeter Commented Dec 28, 2013 at 0:57
- 1 @MattBall: it looks like you've never debugged JavaScript code with NetBeans - it's really simple and worth trying it. Here how to do it quickly: stackoverflow./a/20809988/517705. And the "added plexity" - which means only some minutes of reading+configuring - worth it. This way I can use the IDE I like for debugging and which I have configured, not the browser's inspector which can be a bit more unfortable than the IDE for such tasks. By the way, I admit that the browsers' tools are very smart, I also like and do use them, but like the IDE more for debugging purposes. – Sk8erPeter Commented Dec 28, 2013 at 1:26
1 Answer
Reset to default 5For JavaScript debugging in Chrome, you should use the official NetBeans Connector extension.
Here's an example on how to debug JavaScript code with NetBeans + Chrome + NetBeans Connector:
Debugging and Testing JavaScript in an HTML5 Application https://netbeans/kb/docs/webclient/html5-js-support.html
After creating a new project, you should "Confirm that Chrome with NetBeans Connector is selected in the dropdown list in the toolbar":
(it looks like this in my NetBeans:
)
Put some breakpoints before some lines:
and hit Run. After hitting Run, you will see a yellow warning bar which looks somehow like this, stating ""NetBeans Connector" is debugging this tab":
Do NOT open Chrome's built-in web inspector toolbar now (or you'll get a warning that this breaks the regular debugging process in NetBeans).
Now you can debug JavaScript code in NetBeans, the code will run in Chrome. You should open Window → Debugging → Variables panel to inspect the variables.
Or mouse over some items:
Regarding debugging PHP code, here are some relevant official articles:
- How do I debug PHP projects? - http://wikibeans/HowToDebugPHPProjects
- Configuring PHP Development Environment in Windows - https://netbeans/kb/docs/php/configure-php-environment-windows.html
- Configuring the PHP Development Environment in Linux Ubuntu - https://netbeans/kb/docs/php/configure-php-environment-ubuntu.html
- Configuring PHP, Apache, MySQL, and Xdebug for PHP development in MAC OS X - https://netbeans/kb/docs/php/configure-php-environment-mac-os.html
- Debugging PHP Source Code in the NetBeans IDE - https://netbeans/kb/docs/php/debugging.html
- How to configure XDebug - http://wikibeans/HowToConfigureXDebug
本文标签: How to debug JavaScript and PHP together in the same NetBeans (73) projectStack Overflow
版权声明:本文标题:How to debug JavaScript and PHP together in the same NetBeans (7.3) project? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744316246a2600278.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论