|
iframe.html 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 2 "http://www.w3.org/TR/html4/loose.dtd"> 3 <html> 4 <head> 5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 6 </head> 7 <body>Hello World! 啊啊</body> 8 </html> common.js 1 function $(tagid){ 2 return document.getElementById(tagid); 3 } 4 5 function getDocValue(){ 6 alert($("editor").contentWindow.document.body.innerHTML); 7 } 8 9 function init(){ 10 var win = $("editor").contentWindow; 11 win.document.designMode= "on"; 12 win.document.contentEditable = true; 13 win.focus(); 14 } 15 16 function chgFont() { 17 var win=$("editor").contentWindow; 18 win.document.execCommand("ForeColor",false,"red"); 19 win.document.execCommand("FontSize",false,"10"); 20 win.focus(); 21 } 22 23 function addIMG() { 24 var win=$("editor").contentWindow; 25 win.document.execCommand("InsertImage",false,"img/a.gif"); 26 win.focus(); 27 }
上一页 [1] [2] [3] 下一页 |