
07-16-2009
|
|
|
|
testcase.html
<html>
<head>
<script type="text/javascript">
var editor;
function init() {
editor = document.getElementById('editor');
editor.contentWindow.document.designMode='on';
}
function editor_execCommand(command, value) {
editor.contentWindow.document.execCommand(command, false, value);
}
</script>
</head>
<body onload="init();">
<div>
<button onclick="editor_execCommand('JustifyRight', null);">justify
right</button>
<button onclick="editor_execCommand('insertUnorderedList',
null);">OL</button>
<button onclick="editor_execCommand('formatblock', '<h1>');">H1</button>
|
<button onclick="editor_execCommand('cut', null);">cut</button>
<button onclick="editor_execCommand('paste', null);">paste</button>
</div>
<div>
<iframe width="800" id="editor" src="template.html"></iframe>
</div>
</body>
</html>
|