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