Announcement

Collapse
No announcement yet.

Tools for Ajax Execution Tracking and Debugging?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Tools for Ajax Execution Tracking and Debugging?

    Hi all. I'm in search of a web programming tool primarily for debugging rather than actually development. Presently I use Notepad (backend/code), Krusader (for file access), and plain old Firefox (webUI) for my development work. However, given the incredible level of complexity most websites and web apps are taking these days I'm finding it increasingly more difficult and time consuming to track down bugs when Ajax is involved in the process, unlike in the old days when it was just PHP and HTML involved. Ajax is the most frustrating of all the web languages I've worked with as it doesn't give me good debug info when it hits a problem. Just the BS that the browser console in Firefox tells me. So what I'm wondering is if there's a way to track the order of execution, what files are called, functions are run, and maybe even a browser plugin, or even something I can plug directly into my Ajax statements that'll allow them to forward back to me any errors that the attached PHP scripts may generate.

    IE, user clicks a link -> ajax function "foo" fires -> calls "hello_world.php -> php script errors out with "sorry, no such world" -> ajax sees error -> reports it back to user.

    Or possibly this: user clicks link -> executes ajax function "I love cats" -> reports that said function has been executed -> cats function calls "dogs rule" function -> reports that -> end of execution.

    Even something that will do just those two things would be a huge help.

    #2
    If you want AJAX to report the error to the user, you have to throw and catch that error yourself. I usually throw an exception in the PHP and return an http response with the appropriate http response code. This will then be caught by the ajax call and then you can decide what to do with it, and even view the error using dev tools in the network tab. Using a PHP framework or http library makes this ridiculously easy.

    Comment


      #3
      Okay, thanks. I'll try that.

      Comment

      Working...
      X