XAMPP ajax request

Problems with the Windows version of XAMPP, questions, comments, and anything related.

XAMPP ajax request

Postby kepler » 19. July 2018 11:17

Hi,

In WordPress, I'm makin several calls with ajax. For example:

Code: Select all
$.ajax({
    type: "GET",
    url: ecl_url,
    data: {year: ano, age: 27, country: 'Ireland'},
    success: function(data){
        divn.innerHTML += data;
    }
});


This perfectly works. ecl_url echoes the data, and the url is correctly format. HOWEVER, in another ajax call, like this:

Code: Select all
            $.ajax({
            data: {'user': 'kepler','custom_img_size': custom_img_size,'show_outer': show_outer},
            type: 'POST',
            dataType: 'json',
            url: natal_url,
            success: function($answer) {
                document.getElementById('myReports').innerHTML += $answer.html;
                }
            });


natal_url is also correctly formated. But I not only get no error, I get no data!
This script echoes differently:

Code: Select all
...
      $html .= '</font></td></tr>';
      $html .= '</table>';
      $html .= "<br /><br />";
     
      echo json_encode(array(
        'html' => $html
      ));
      exit();



Any idea what's wrong? In a server online it all works - in XAMPP doesn't...

Kind regards,

Kepler
kepler
 
Posts: 5
Joined: 07. June 2017 08:43
XAMPP version: 5.6.30
Operating System: Windows

Re: XAMPP ajax request

Postby asprin » 23. July 2018 08:52

Could you open the browser console (usually F12) and see what you're getting back as response (usually shown under the "networks" tab)?
User avatar
asprin
 
Posts: 3
Joined: 23. July 2018 08:21
XAMPP version: haven't installed it yet
Operating System: Windows 10

Re: XAMPP ajax request

Postby kepler » 23. July 2018 10:16

Hi,

Thanks for the reply. I get all the requests withh a 200 OK code.... I cant seem to find, however, nothing regarding the request I spoke...

Kind regards,

Kepler
kepler
 
Posts: 5
Joined: 07. June 2017 08:43
XAMPP version: 5.6.30
Operating System: Windows


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 134 guests