Basically I am calling from a CFM another CFM which creates an object, calls several methods on this object and logs a user in; otherwise it prints an error on the screen.
Rather then printing the Error, is there a way to take a CFM and have it send a JSON object to the file that called it?
Here's my ajax:
// processing the login form using jQuery
$("#loginForm").submit(function(event){
// prevents the form from being submitted, the event is the arg to the function
event.preventDefault();
// stores the data from the form into a variable to be used later
dataString = $("#loginForm").serialize();
// the AJAX request
$.ajax
({
type: "POST",
url: "/helpers/auth/ldap/login_demo.cfm",
data: dataString,
//dataType: "text",
success: function()
{
location.reload();
},
error: function(ErrorMsg)
{
$("#hiddenLoginError").show("fast");
$("#loginForm p").css("margin-bottom","3px");
}
});
});