I am using jQuery 2.0.2 with ajax to call a php page which executes a command to start a java client:
$j(document).ready(function(){
$j(".do_remote_sync").on("click",function(event) {
var d = "";
$j.ajax({
data: \'test=test2\',
type: \'POST\',
url: \'sync_remote.php\',
success: function(data) {
d = data;
}
});
//alert("after ajax");
});
});
The sync_remote.php page only contains following line:
exec("java -jar RemoteSync.jar config.properties", $output, $return_var);
The problem is now that the sync_remote.php page is only called if I write an "alert" command after the ajax call (alert("after ajax");).
If I comment out this line the ajax call is most probably not called!
The sync_remote.php page works without problems if a call it directly.
Question
Why the ajax call is not executed without the "alert" command?