In my first steps, I'm using this not rational way, as described below:
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.
For 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.org/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:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With