In a web form application 2010, I have the following ajax code:
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: document.location.pathname + "/GetStudentLetter",
data: "{ " + strData + " }",
dataType: "json",
success: function(data) {
LoadEditor(JSON.parse(data.d), milestone);
},
error: AjaxFailed
});
}}
The line of code I am having a problem with is: error: AjaxFailed
When this occurs in the application, an internal server error is generated. However I would like to know how to write better code so that I know what is really wrong with the application? Thus would you show me the following:
1`. How to write better code so that I know what is really wrong?
2. This application does not really have a log file to keep track of error messages that I am aware of. Thus can you tell where I can write the error message so that I know what the really error message is? I am guessing even to write the log file to the application server would be ok. Just let me know what you think are the best location is.
3. For initially debugging before placing the error message in a file, how would I write an 'alert' display message so that I know what is wrong