SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    Patience... bronze trophy solidcodes's Avatar
    Join Date
    Jul 2006
    Location
    Philippines
    Posts
    911
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    How to see error behind AJAX?

    Sorry If I posted this here, because it's related to AJAX


    Aside from viewing the error using Error Log in the CPANEL.
    How do you see a PHP error behind an AJAX page?

    I have a PHP function that is being called after the AJAX form page is executed.
    My problem is since the form page doesn't refresh the whole page, I don't have any idea what's happening behind the AJAX.

    How do I see the PHP error behind an AJAX page?

    What is your solution to this?

    Thanks in advanced.
    I Love coding...
    Don't click this link.

  2. #2
    SitePoint Mentor bronze trophy
    fretburner's Avatar
    Join Date
    Apr 2013
    Location
    Brazil
    Posts
    1,257
    Mentioned
    32 Post(s)
    Tagged
    5 Thread(s)
    All the major browsers have built-in developer tools that allow you to inspect requests and the responses. The first thing I'd do is check if you getting any kind of response from the server which might give you a clue as to the problem. You should also have access to PHP's error log somewhere on your web hosting account (if I remember correctly, cpanel only gives you access to the apache error log), sometimes it's in the public_html folder of your site (or possibly the root) you'll have to have a dig around.

  3. #3
    Patience... bronze trophy solidcodes's Avatar
    Join Date
    Jul 2006
    Location
    Philippines
    Posts
    911
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    I'm familiar with FireBug but I'm not good at it.
    I Love coding...
    Don't click this link.

  4. #4
    SitePoint Mentor bronze trophy
    fretburner's Avatar
    Join Date
    Apr 2013
    Location
    Brazil
    Posts
    1,257
    Mentioned
    32 Post(s)
    Tagged
    5 Thread(s)
    OK, so open Firebug and select the Net tab, and then navigate to or reload the page you're having problems with. As the page loads, you should see a series of GET requests appear in Firebug panel as the browser loads all the CSS, JS, images and stuff like that. Click the menu button for XHR (ajax requests) and then trigger the ajax request from the page. You should see the request to the server appear, which you can then click and choose the 'Response' tab which will show you the reply from the server.

  5. #5
    Patience... bronze trophy solidcodes's Avatar
    Join Date
    Jul 2006
    Location
    Philippines
    Posts
    911
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    @fretburner
    I'm learning.
    But I don't see any error.
    Thanks dude.
    I Love coding...
    Don't click this link.

  6. #6
    SitePoint Addict ketting00's Avatar
    Join Date
    Jul 2011
    Posts
    310
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Use chrome and Ctrl + Shift + j is much simpler.


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
  •