打开新窗口测试HTML代码



代码如下:
    function runCode(code)
    {
		var win = window.open('','_blank','');
		win.document.open('text/html', 'replace');
		win.opener = null;
		win.document.write(code);
		win.document.close();
    }

动态执行JS代码



代码如下:

    function runJs(code)
    {
		new Function(code)();
    }

相关文章:

  • 2021-08-16
  • 2021-06-21
  • 2022-01-05
  • 2021-09-29
  • 2022-02-13
  • 2021-10-22
  • 2021-11-30
  • 2021-07-10
猜你喜欢
  • 2022-12-23
  • 2021-06-07
  • 2022-12-23
  • 2022-12-23
  • 2021-10-03
  • 2022-01-30
相关资源
相似解决方案