Quantcast
Channel: CodeProject Latest postings for ASP.NET
Viewing all articles
Browse latest Browse all 3938

Ajax error handling logic

$
0
0
In 2 ajax calls that are listed below, there are 2 places that say 'error: AjaxFailed'.  
 
$.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 
                });            
            if (milestone == '999') { 
                $.ajax({ 
                    type: "POST", 
                    contentType: "application/json; charset=utf-8", 
                    url: document.location.pathname + "/Gettattschyr", 
                    data: "{ " + strData + " }", 
                    dataType: "json", 
                    success: function (data) { 
                        successtest(eval(data));                       
                    }, 
                    error: AjaxFailed 
                }); 
            }                
         }           
        function successtest(sletter) { 
            var sle = sletter 
            _txtattschyr = sletter.d 
            if (_txtattschyr > '1') { 
                alert('You have selected student(s) having more than one Entry for the current school year. '); 
                return                 
            }               
I would like to have better error handling so that I know what is exactly wrong. From the first ajax call, I got a 500 server error problem 
in production. By guessing, I found out that I needed to increase the maximum size of the jason file that is posted above.
 
Thus can you tell and/or point me to urls that will show me better error logic that I can use?

Viewing all articles
Browse latest Browse all 3938

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>