Debugging AJAX applications (javascript/PHP)

I am trying to debug javascript code(in my html file) that reaches out to a php application(AJAX app) running on my "localhost".  When right clicking in the HTML and selecting "Debug myApplication" ...  the URL in the browser is: file:///myfilelocation.html and it works just for the html/javascript application(debugging the javascript).

The problem with it not using a "localhost:8888//myfilelocation.html" is that it loses the hooks(debugging) to the php application.

if I put in the browser url "locahost:8888//myfilelocation.html"  there is no "listening" for javascript breaks set in the code,  but the php breaks work as expected (I have set up debugging with xdebug).  

Is there a way to have the best of both worlds and debug the javascript and php (a nice thing in the AJAX world)?  Right now I can not carry on a AJAX debugging conversation with breakpoints in the html(javascript) and the php.

I have purchased PHPStorm(which I'm using for this app).  Thanks for your help

0
3 comments
Avatar
Permanently deleted user

Hello Chuck,

When right clicking in the HTML and selecting "Debug myApplication" ...  the URL in the browser is: file:///myfilelocation.html and it works just for the html/javascript application(debugging the javascript).

For the script running on the server you need to use 'JavaScript Remote Debug' run configuration:
remote_debug.png
Also see http://devnet.jetbrains.com/thread/295035

As for PHP just enable 'listening' mode and everything should work.

Thank you for feedback!

0
Avatar
Permanently deleted user

Thanks Nicolay,  The javascript starts up properly as a remote app and debugs when Firefox is configured as the browser,  but not when chrome is configured as the browser.  They both work fine for php.  Is there a javascript debug plugin for chrome to see the request for a remote url from phpstorm?  Thanks

0
Avatar
Permanently deleted user

Hello Chuck,

The javascript starts up properly as a remote app and debugs when Firefox is configured as the browser,  but not when chrome is configured as the browser.  They both work fine for php.  Is there a javascript debug plugin for chrome to see the request for a remote url from phpstorm?

See http://blog.jetbrains.com/webide/2011/04/debugging-javascript-in-google-chrome/

Thank you for feedback!

0

Please sign in to leave a comment.