window.onerror = function (msg, url, linenumber) { if (url == undefined) url = ""; if (msg == undefined) msg = ""; if (linenumber == undefined) linenumber = ""; if (DDS.IEBad()) { document.location.href = "https://" + location.host + "/Home/VersaoIE"; return false; } if (url.indexOf("jquery-") == -1 && url.indexOf("bootstrap.") == -1 && linenumber > 0) { if (msg.indexOf("NPObject") == -1) { var mensagem_de_erro = ('Mensagem de Erro: ' + msg + ' \r\nURL: ' + url + ' \r\nNumero da Linha: ' + linenumber + ' \r\nNagegador: ' + DDS.Qual_Nagegador() + ' \r\n' + navigator.userAgent).replace('&', '').replace('?', '') + ' \r\nCookie ' + document.cookie; if (location.host.indexOf('localhost:') > -1) { alert(mensagem_de_erro); } else { var http = new XMLHttpRequest(); var url = ""; if (location.host.indexOf("https") > -1) { url = "https://" + location.host + "/Home/Erro"; } else { url = "http://" + location.host + "/Home/Erro"; } var params = "mensagem_de_erro=" + mensagem_de_erro; http.open("POST", url, true); http.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); http.setRequestHeader("Content-length", params.length); http.setRequestHeader("Connection", "close"); http.onreadystatechange = function () { if (http.readyState == 4 && http.status == 200) { } }; http.send(params); } return true; } } };