My working CodeIgniter site is giving a 500 Internal Server Error while hosting it on MediaTemple. It is happening during a jQuery Ajax call.
I have no idea what could have gone wrong. Is the error from the controller or the model? My Ajax call:
$.ajax({
url: "<?php echo site_url('invites/save_email') ?>",
type: 'POST',
data: form_data,
success: function(msg) {
window.location.href = "<?php echo site_url('invites/moreinvites')?>"
return true;
},
error: function (xhr, ajaxOptions, thrownError) {
alert(xhr.status);
alert(thrownError);
alert(xhr.responseText);
}
});
xhr.responseText has returned me <p>The action you have requested is not allowed.</p>
. But what does that mean?
Clear your browser cache and cookies Check these articles on deleting the cache on an Android phone or iPhone, if you use a mobile device. Alternatively, you can test opening the page from another browser. For instance, if you use Chrome, try Firefox or vice versa.
The 500 Internal Server Error is a very general HTTP status code. It means something has gone wrong on the website and webserver is unable to specify what exactly, thus failing in fulfilling the request made by the client.
You can try using alert(xhr.responseText);
or console.log(xhr.responseText);
(the later will show up in your browser console e.g. firebug) in your error callback, doing so you can get the message associated with the exception (if any).
error: function (xhr, ajaxOptions, thrownError) {
alert(xhr.status);
alert(xhr.responseText);
alert(thrownError);
}
or
error: function (xhr, ajaxOptions, thrownError) {
console.log(xhr.status);
console.log(xhr.responseText);
console.log(thrownError);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With