Stepping through PHP and JavaScript code in Debugger
We used PhpED for editing of HTML and JavaScripts:
All sources for the scripts used in this article can be found here.
Once you mastered this setup debugging of GiveAd.php is almost trivial. You can:
Open GiveAd.php in PhpED
Open FireFox and enable FireBug
Point your browser to
http://localhost/ShowAd.html
When you do, youll notice that PhpED became active execution of GiveAd.php is interrupted at DebugBreak() line as shown on the picture below:
You now have the full control over the execution of the script:
Check the values of the variables
Look at the output in Output Window
The full set of PHP debugging features is available.
You can easily switch from PHP debugging to JavaScript debugging in FireFox.
To run through the rest of the GiveAd.php script, simply hit Run in Debugger button again and the response will be generated and sent back to the JavaScript in ShowAd.html
Once that happens, you can start stepping through your JavaScript file in FireBug.