SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Evangelist
    Join Date
    Mar 2011
    Location
    Bellingham, WA
    Posts
    450
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Tracking php errors through AJAX calls

    Hello!

    When I make an AJAX call to a php script via jquery and there´s a php parse error, I´d like to be able to view it. Right now, if there´s an error in the php script, the php script just stops and there´s no returning message. Is there any way to view php errors? I've googled this question and it looks like there's something called FirePHP which could help, but surely there's an easy way to just echo them out or alert them via jquery?

  2. #2
    SitePoint Addict
    Join Date
    Apr 2011
    Posts
    266
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Hi
    In your Ajax script you can use: alert(ajaxrequest.responseText); to see the server response in window browser, or: console.log(ajaxreq.responseText); to see the result in console, for example with Mozilla Firefox and the FireBug addon.
    In php add this code, to return all the errors:
    Code:
    ini_set('display_errors',1);
    error_reporting(E_ALL);
    Free: Web Programming Courses HTML, CSS, Flash
    Web Programming: AJAX Course and PHP-MySQL Course video Lessons
    Good JavaScript and jQuery course for beginners

  3. #3
    SitePoint Evangelist
    Join Date
    Mar 2011
    Location
    Bellingham, WA
    Posts
    450
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Cool! Thanks...


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •