<commit_before>// testing for checkValidity
$(document).ready(function testCheckValidity($){

  $('textarea.eg').each(function codeMirrorize(i, el){
    var html_id = 'html'+i;
    $(el).after('<button class="'+html_id+'">Update</button><br/><iframe src="javascript:;" id="'+html_id+'"></iframe>');
    var html_el = $('#'+html_id)[0];
    var editor = CodeMirror.fromTextArea(el, {
      parserfile: ["parsexml.js", "parsecss.js", "tokenizejavascript.js", "parsejavascript.js", "parsehtmlmixed.js"],
      path: "codemirror/js/",
      stylesheet: ["codemirror/css/xmlcolors.css", "codemirror/css/jscolors.css", "codemirror/css/csscolors.css"],
      height:"dynamic",
      onChange: function(){$('button.'+html_id).attr('disabled', false);},
      onLoad: function (ed) { 
	  editor = ed; // set the editor (the global editor variable is not set yet.)
	  update_html();
	  $('button.'+html_id).click(update_html);
	  },
      iframeClass: 'source',
      minHeight: '10'
    });
    function update_html(ed){
      alert(editor.getCode());
      $('body', html_el.contentDocument).html(editor.getCode()); // set the content of the iframe
      $(html_el).height($(html_el).contents().find("html").height()); // set the height of the iframe dynamically.
      $('button.'+html_id).attr('disabled', true); // disable the update button because the iframe has already been updated.
    };

  });
});<commit_msg>debugging iframe. srcipts are not getting through. May be problem with getCode.<commit_after>// testing for checkValidity
$(document).ready(function testCheckValidity($){

  $('textarea.eg').each(function codeMirrorize(i, el){
    var html_id = 'html'+i;
    $(el).after('<button class="'+html_id+'">Update</button><br/><iframe src="javascript:;" id="'+html_id+'"></iframe>');
    var html_el = $('#'+html_id)[0];
    var editor = CodeMirror.fromTextArea(el, {
      parserfile: ["parsexml.js", "parsecss.js", "tokenizejavascript.js", "parsejavascript.js", "parsehtmlmixed.js"],
      path: "codemirror/js/",
      stylesheet: ["codemirror/css/xmlcolors.css", "codemirror/css/jscolors.css", "codemirror/css/csscolors.css"],
      height:"dynamic",
      onChange: function(){$('button.'+html_id).attr('disabled', false);},
      onLoad: function (ed) { 
	  editor = ed; // set the editor (the global editor variable is not set yet.)
	  update_html();
	  $('button.'+html_id).click(update_html);
	  },
      iframeClass: 'source',
      minHeight: '10'
    });
    function update_html(){
      alert(editor.getCode());
      var w = html_el.contentWindow;
      w.document.open();
      w.document.write(editor.getCode());
      w.document.close();
      //$('body', html_el.contentDocument).html(editor.getCode()); // set the content of the iframe
      $(html_el).height($(html_el).contents().find("html").height()); // set the height of the iframe dynamically.
      $('button.'+html_id).attr('disabled', true); // disable the update button because the iframe has already been updated.
    };

  });
});
{'fraction_non_alphanumeric': 0.1896551724137931, 'fraction_numerical': 0.001989389920424403, 'mean_word_length': 3.9621710526315788, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '26782', 'n_tokens_mistral': 991, 'n_tokens_neox': 950, 'n_words': 201}