SoFunction
Updated on 2025-04-07

Run code [html][/html] in Z-Blog (pure JS version)


function RunCode() { 
  var ele = ("textarea"); 
  for (var i=0; i<; i++) { 
    with (ele[i]) { 
      if (className != "code") continue; 
      var o = ("p"); 
      var a = ("a"); 
      var em = ("em"); 
       = "runCode"; 
       = "javascript:;"; 
= "Run code";
       = function() { 
        var win = ('', "_blank", ''); 
        ('text/html', 'replace'); 
        ((/\u00a0/gi, " ")); 
        (); 
      } 
= "(Tip: You can modify some code first and then run)";
      (a); 
      (em); 
      insertAdjacentElement("afterEnd",o); 
    } 
  }