on click run button open new window with data of html, css and javascript code editor. css is pass in new window but html data not, in html using code mirror that can pass in javascipt
run botton code is here
<div style="float:left; width:100%; height:93px;">
<span class="containerTitle" style="top:65px;">
<a href="javascript:;" class="button_example" id="result" style="color: white;">Result</a>
</span>
</div>
on this button call function "nwin"
$("a#result").click(nWin);
nwin function is,
<script>
function nWin() {
var w = window.open();
$(w.document.body).html("<style>" + $('#css').val() + "</style>"+ $('#html').val() );
}
</script>
html data codemirror is,
<div class="codecontainer" id="htmlContainer" style="max-width:40%;">
<span class="containerTitle">HTML</span>
<textarea class="code" id="html" style="display: none;"></textarea>
</div>
that pass value in editor variable,
<script>
var editor = CodeMirror.fromTextArea(document.getElementById("html"), {
lineNumbers: true,
mode: "text/html",
matchBrackets: true
});
</script>
how to set the value editor in function nwin in html window