Skip to main content

Javascript Alerts to Display Console Errors & Messages

By December 9, 2016Blog, Javascript, Snippets
Allure Web Solutions Code Snippet

Sometimes you don’t have access to a JavaScript console and need to display console errors some other way. This could be a common case for ┬ámobile development. With the below snippet, console errors will appear within alerts real time.

if (typeof console  != "undefined") 
    if (typeof console.log != 'undefined')
        console.olog = console.log;
        console.olog = function() {};

console.log = function(message) {
' + message + '
console.error = console.debug = = console.log

// Credit:



Author allure

More posts by allure

Leave a Reply

Designed by

best down free | web phu nu so | toc dep 2017