javascript - Is there a way to have console.log() log messages in IE with the console closed? -
i have been reading console.log in ie works when console exists (is open).
i working through timing issue in ie , whatever reason can replicate issue when console closed. therefore, using console.log not me since cannot replicate issue when console open.
is there anyway have console.log work in ie console closed? there approach use write debug data browser?
if problem happens when console closed, may possible console.log
failing.
i'll put @ top of master page or layout page, guarantee runs before else:
if (!window.console) { window.console = { log: function() { } }; }
so if console
doesn't exist, in old ie, won't cause issues if call console.log
. of course, if potentially use of other console
functions, define well.
you can assign real log
instead of dummy call - maybe log
can execute ajax request simple handler logs message on server.