Question
How to trap CF error inside AJAX function
We are using Coldfusion MX7. I am calling a CFM file in AJAX
function. I would like to know if there is a way to display the
server-side error inside the AJAX function.
For example, the following is the function called after receiving response from the server (AJAX call).
function loginReply() {
if(http.readyState == 4){
var response = http.responseText;
if(response == 0){
// if login fails
alert(errorDetails); //Can I access the Coldfusion error details here?
} else {
document.getElementById('login_response').innerHTML = response;
}
}
}
Thanks
For example, the following is the function called after receiving response from the server (AJAX call).
function loginReply() {
if(http.readyState == 4){
var response = http.responseText;
if(response == 0){
// if login fails
alert(errorDetails); //Can I access the Coldfusion error details here?
} else {
document.getElementById('login_response').innerHTML = response;
}
}
}
Thanks
