Codechef4u is a community for computer professionals,by computer professionals,just like you; who loves sharing and helping each others,Join them
Share your post

Answers


use error function(.error()) to catch error  

Bind an event handler to the “error” JavaScript event, 

Code sample:

$.ajax({
      url:'@Url.Action("xyzIndec", "Tests")',
      type: 'GET',
           cache: false,
           success: function (data) {
                 $('#SamplePage). html (data);
           }
        ,
        error: function (XMLHttpRequest, textStatus, errorThrown)   {
               $('#waiting').hide(500);
               $('#message').removeClass().addClass('error')
                   .text('There was an error.').show(500);
               $('#SampleForm').show(500);
            }
      });

Share your answer


Share as a guest

Please subscribe me to the CodeChef4U.

By creating your new answer, you agree to the privacy policy and terms of service.