NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Debugging AJAX with JQuery & Drupal?


Joined: 06 Aug 2007
Posts: 37
Location: Atlanta, Georgia USA
Reply with quote
Hi,

I am using PhpEd for developing on Drupal and love it but I am now running into a problem; I need to debug AJAX calls made by JQuery. I note that there are several mentions of XOAD but my clients wants me to use JQuery because it is preferred when using Drupal and we already have a lot of JQuery code.

What I want to be able to have is the debugger to be triggered on an AJAX call so I can step through code and see what is happening but it appears that I can only get the debugger to wake up when the external browser makes a request (I can't use the internal browser because it lacks mod_rewrite which is required for correct operation of my Drupal apps.)

Please help? I really hope PhpEd is more capable than just being able to debug AJAX based on XOAD.
View user's profileFind all posts by MikeSchinkelSend private messageVisit poster's website
Site Admin

Joined: 13 Jul 2003
Posts: 8334
Reply with quote
It makes no difference what browser (embedded or external) you use. What makes difference is server you run against. If you need mod_rewrite, you can't use anything but Apache. So you have to set Run Mode to 3rd party/HTTP server and set the other project properties accordingly.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 06 Aug 2007
Posts: 37
Location: Atlanta, Georgia USA
Reply with quote
dmitri wrote:
It makes no difference what browser (embedded or external) you use. What makes difference is server you run against. If you need mod_rewrite, you can't use anything but Apache. So you have to set Run Mode to 3rd party/HTTP server and set the other project properties accordingly.


Thanks for the reply, but...<sigh> it didn't address my concern; it only addressed a tangential comment I made in hopes to expedite getting an answer. Oh the irony!

I do see your point now, I was confused, but my issue is was not that but instead figuring out how to get PhpEd to trigger the debugger on an AJAX call made by JQuery, hence the title of my post. Maybe the solution I need is as simple as your previous answer but I just don't yet know it?

Thanks in advance for your help.
View user's profileFind all posts by MikeSchinkelSend private messageVisit poster's website
Site Admin

Joined: 13 Jul 2003
Posts: 8334
Reply with quote
<sigh> the irony is that "How to run debug session" is a FAQ Smile
Feel free to post if you have any problems after you try that Smile

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Why didn't you mention the FAQ in your first reply?


Joined: 06 Aug 2007
Posts: 37
Location: Atlanta, Georgia USA
Reply with quote
dmitri wrote:
<sigh> the irony is that "How to run debug session" is a FAQ Smile
Feel free to post if you have any problems after you try that Smile


Well now that is it clear we are in a pissing match.... My reply would have been ironic had you mentioned that FAQ in your first reply, which you didn't.

So let's retrace my steps. When I googled for "debugging+phped+ajax" I did find an article entitled "Ajax PHP Debugging with DBG PHP Debugger." That FAQ implied that I needed to install XOAD framework in order to be able to debug it and by having headings like "How to run Ajax based PHP in debugger" it implied to me that it was the way that you've envisioned to debug AJAX in PhpEd.

The only other article with "Ajax" returned by that google result was entitled "Ajax and PHP" reasonably leaving me to assume that those two articles were all that NuSphere had written about debugging AJAX with PhpEd. To have expected me to have found the obtusely referenced "HOWTO: Run debug session?" when I was looking for help with AJAX debugging given I have been successfully debugging with PhpEd from the browser for months is just a bit much. Seems if that's how one should configure PhpEd for debugging AJAX maybe you should at least incorporate the word AJAX into that document before chiding a customer for not finding it?

And after all that, the FAQ still only gives me a vague understanding of how to get triggering PhpEd to load the debugger when using JQuery (and yes, I am using Apache.)

BTW, I'm tentatively scheduled in January 2008 to present PhpEd both the Atlanta PHP User Group and the Atlanta Drupal User Group, but given how the support team at NuSphere seems more interested in showing customers where they believe them to be wrong instead of focusing on how best to help customers, I now wonder if wouldn't be doing my fellow Atlanta PHP & Drupal developers a disservice by showing PhpEd to them...
View user's profileFind all posts by MikeSchinkelSend private messageVisit poster's website
Site Admin

Joined: 13 Jul 2003
Posts: 8334
Reply with quote
AJAX has no direct relation to php debugging at all.
It runs regular HTTP requests, the same way as a browser and there is nothing new on how to run debug session. There are several ways on how to achieve this and they all are explained there in this topic http://forum.nusphere.com/howto-run-debug-session-t585.html
Sorry, that I didn't provide this link from the beginning.

In case of AJAX, the only specific is that the request is done with URL formed by software. And this software does not know that you need to run debug session with php. With XOAD ajax sample we demonstrated how to pass php debugger request to the server. This request is what runs debug session.
Also, I'd point out that you can't debug synchronous AJAX calls with embedded browser, or it will be locked up due to obvious deadlock. So either use asynchronous ajax calls or run them from an external browser.

Final note. You can't run new debug session while you're debugging something. In other words, if you debug scriptA, you can't start debug sesession for scriptB until scriptA is finished.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 19 Jun 2006
Posts: 24
Location: florida
Reply with quote
so now that we have determined that debugging AJAX libraries in phpEd is not something dmitri is very interested in (except in how it relates to the server side PHP calls), is anyone using a seperate tool (like the JavaScript Debugger Firefox add-on https://addons.mozilla.org/en-US/firefox/addon/216) to create an "integrated" debugging environment that links client-side JS step-debugger to phpEd?
View user's profileFind all posts by menriquezSend private messageVisit poster's websiteYahoo Messenger


Joined: 19 Jun 2006
Posts: 24
Location: florida
Reply with quote
menriquez wrote:
... is anyone using a seperate tool (like the JavaScript Debugger Firefox add-on https://addons.mozilla.org/en-US/firefox/addon/216) to create an "integrated" debugging environment that links client-side JS step-debugger to phpEd?


hmmm...never mind i see that HotShot is doing this very thing on this thread...

can-phped-debug-the-java-script-t1811.html?highlight=ajax
View user's profileFind all posts by menriquezSend private messageVisit poster's websiteYahoo Messenger
Debugging AJAX with JQuery & Drupal?
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic