Make console Un-redefining - Javascript Language Basics

Javascript examples for Language Basics:console

Description

Make console Un-redefining

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
   </head> 
   <body> 
      <script type="text/javascript">
console = {};
try {//from   w  w  w  .ja  v  a 2 s  .  c o  m
console.log('test');
} catch(e){
    console.log(e);
    console.log('No console');
}

      </script> 

      <iframe id="text"></iframe> 

      <script type="text/javascript">
console = window.frames[0].console;
try {
console.log('test');
} catch(e){
    console.log('No console');
}

      </script>  
   </body>
</html>

Related Tutorials