Load codemirror editor in an iframe - Javascript CodeMirror

Javascript examples for CodeMirror:Configuration

Description

Load codemirror editor in an iframe

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <link rel="stylesheet" href="https://codemirror.net/doc/docs.css"> 
      <link rel="stylesheet" href="https://codemirror.net/lib/codemirror.css"> 
      <script src="https://codemirror.net/lib/codemirror.js"></script> 
      <script src="https://codemirror.net/mode/htmlmixed/htmlmixed.js"></script> 
      <style type="text/css">

.CodeMirror {float: left; width: 100%; height: 100%; }


      </style> 
   </head> 
   <body> 
      <div> 
         <textarea id="content" name="content"></textarea> 
      </div> 
      <script>
      var editor = CodeMirror.fromTextArea(document.getElementById('content'), {
        mode: 'application/x-httpd-php',
        lineNumbers: true/*ww w.ja  v  a  2 s.c om*/
      });
    
      </script>  
   </body>
</html>

Related Tutorials