I have the following jQuery for doing an Ajax call and it works fine:
jQuery(document).ready( function($){
$( "#mystatus" ).change(runMyStatus);
function runMyStatus() {
var mystatus = this.value;
var data = {
'action': 'bikeride_mystatus_function',
'mystatus': mystatus,
// 'rideID' : 123,
'nonce': frontEndAjax.nonce
};
var ajaxRequest = $.ajax({
url: frontEndAjax.ajaxurl,
type: "post",
data: data
});
ajaxRequest.done(function(response) {
alert('Success');
});
ajaxRequest.fail(function(jqXHR, textStatus, exception) {
alert('Error.\n' + jqXHR.status + ' ::' + textStatus + ' ::' + exception);
});
} // end runMyStatus
// end document ready
});
If I uncomment the line with rideID then it fails with a "500" status (I tried putting 123 in quotes but it made no difference). If I change the type from "post" to "get" then it works. This error occurs even with no plugins enabled and using the twentyseventeen theme. Any idea what is causing the error?