Reputation: 899
I have getJSON code like this:
$('#selected_article').change(function(){
$.getJSON('<?php echo $_SERVER['SCRIPT_NAME']; ?>', {
ajax: 'ajax_article_partlist' ,
parent_article: $('#selected_article').val()
},
function(data) {
console.log(data);
});
});
I can't get the function(data)
. The console.log
won't trigger an alert. On the PHP side I get stuff that I need; I can see it in the error_log
, and I tried with print
and also echo
.
Upvotes: 2
Views: 159
Reputation: 12815
In developer tools, see network tab. Once you run your ajax request - it should appear there. You can view what is returned. Looks like your response is not a valid JSON and that is why success calback is not called.
Upvotes: 2