$.ajax(...) call error - what is wrong?
-
$.ajax({
'url': 'calendar_task.php',
'data': {'action': 'updateTime', 'id': '1', 'timeSector': timeSector, 'start': startTime, 'end': endTime},
'dataType': 'json',
'error': function (XMLHttpRequest, textStatus, errorThrown) { alert(textStatus); },
'success': function(data) {
alert(data);
}
});
output is an alert with "error" which is thrown because there is an error in the ajax call...what could be the reason for this? all the variables passed are defined. i commented out the url php script so that all it returns in:
print json_encode("test");
that means the problem is in the ajax call? syntax?