Posted By

shapeshifta on 08/11/10


Tagged

console firebug


Versions (?)

Show alert if console is not available in Browser


 / Published in: JavaScript
 

  1. if(typeof window.console === 'undefined') {
  2. window.console = {
  3. log : function(str) {
  4. alert(str);
  5. }
  6. }
  7. }
  8.  
  9. // mehr JS Code...
  10. console.log("I am an alert? Then console is not available");
  11. alert("I am just a simple alert");

Report this snippet  

You need to login to post a comment.