javascript - Error callback in Ajax call -
i using jquery method trigger ajax call.
function fetchquestion(questionid,index){ $.ajax({ url: '${createlink(action: 'fetchquestion')}', data: {id:questionid,grantassessmentid:${grantassessmentid}}, cache: false, success: function(html) { $('div[id="questioncontent"]').html(html); }, error: function(e,status){ console.log("inside error..") } }); }
in controller's action, throw exception(throw new exception("some message")) returns 500 response ajax call. in error callback not able catch it.
try using third argument, thrown error there
http://api.jquery.com/jquery.ajax/
error type: function( jqxhr jqxhr, string textstatus, string errorthrown )
Comments
Post a Comment