javascript编辑器预览模式解密
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>javascript编辑器预览模式解密</title> </head> <body> <div id = "btn">按钮</div> <script> btn = document.getElementById('btn'); btn.onclick = function(){ var cc = window.open ('','newwindow','height=100,width=400,top=0,left=0,toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no') cc.document.write("xxxxxx"); cc.focus() } /*预览模式解密: 1、拿到要预览页面的html; 2、打开一个新窗口; 3、将拿到的html写入到新窗口; */ </script> </body> </html>
坚持下去就能成功