Is it possible to dump JavaScript errors to a div in HTML?
Date : March 29 2020, 07:55 AM
Hope that helps It sounds like you already have the ability to execute JS working, and just need to capture error output? If so, you should be able to do so by wrapping your execution code in a try ... catch block: var result;
try {
result = eval($("#console-input").val());
} catch (ex) {
if (ex !== null && typeof ex !== "undefined") {
if (ex.message) ex = ex.message;
} else {
ex = "An unknown error occurred.";
}
result = ex;
}
$("#console-output").append($("<p/>").text(result));
$("#console-input").val("");
|
Why is my JavaScript causing HTML Validation errors?
Date : March 29 2020, 07:55 AM
this will help Really just expanding on MicronXD's answer. The character immediately following the
|