Question #37190

how to fix Consol.log Script error is "undefined" ?

Expert's answer

function LogException(e) {
if (window.console // check for window.console not console
&& window.console.log) window.console.log(e);
// Other logging here
}

try {
... // code throwing error
} catch (e) {
LogException(e); // works fine
}
LATEST TUTORIALS
APPROVED BY CLIENTS