Wednesday, 11 October 2017

MVC - Json - Fix Error - JavaScript runtime error: Invalid character


watch on youtube

To fix it replace

del.error = function(msg){
   alert(JSON.parse(msg.responseText));
}

with

del.error = function (x, status, er){
   var elem = document.createElement('html');
   elem.innerHTML = x.response.Text;
   alert(elem.getElementsByTagName('title')[0].innerHTML);
}

No comments:

Post a Comment