We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4d59828 commit 37b7eafCopy full SHA for 37b7eaf
demo/preview.html
@@ -36,6 +36,7 @@ <h1>CodeMirror 2: HTML5 preview</h1>
36
<meta charset=utf-8>
37
</head>
38
<body>
39
+ <p>Canvas pane goes here:</p>
40
<canvas id=tutorial width=250 height=250></canvas>
41
<script>
42
var canvas = document.getElementById('tutorial');
@@ -64,7 +65,8 @@ <h1>CodeMirror 2: HTML5 preview</h1>
64
65
});
66
67
function updatePreview() {
- var preview = document.getElementById('preview').contentDocument;
68
+ var previewFrame = document.getElementById('preview');
69
+ var preview = previewFrame.contentDocument || previewFrame.contentWindow.document;
70
preview.open();
71
preview.write(editor.getValue());
72
preview.close();
0 commit comments