The problem is that the alert message "TEST" does not appear, although the function getData.php
is successfully executed and returns some data. I checked it in Firelog, where I can see the following output:
Array{"arr":[["1","EZY14ZM","2013-05-29 16:44:38","2013-05-29 16:45:28"],["1","VLG1307","2013-05-29 16:47:05","2013-05-29 16:47:55"],["1","WZZ212","2013-05-29 16:49:12","2013-05-29 16:50:02"]],"dep":[["1","VLG8306","2013-05-29 16:59:17","2013-05-29 17:00:00"],["1","VLG3786","2013-05-29 17:07:29","2013-05-29 17:08:12"],["1","IBE1851","2013-05-29 17:08:38","2013-05-29 17:09:21"],["1","DLH58Y","2013-05-29 17:09:47","2013-05-29 17:10:30"]]}
How to solve this problem?
function show_data() {
$.getJSON(
'h_index.php?module=mod_1&pag_mod=getData.php',
function(data) {
alert("TEST");
}
);
}
getData.php
<?php
//...
echo json_encode(array('arr' => $rows_arr, 'dep' => $rows_dep););
die();
?>