All pastes #729793 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-10-08 10:31 UTC
rendered paste body
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
	<title>WYSIWYG</title>
	<link rel="stylesheet" type="text/css" href="wysiwyg.css" />
</head>
<body>
<script type='text/javascript'>
  var hForm = null;
  var hFormContent = null;
  function insertImage() {
      hFormContent.execCommand("InsertImage", false, 'http://');
  }
  
  function test() {
      hForm = document.getElementById('MidasForm');
      if (hForm.contentWindow && hForm.contentWindow.document.designMode) {
          hForm.contentWindow.document.designMode='on';
      } else {
         alert('Update your browser !');
      }
      
      hFormContent = hForm.contentWindow.document;
      hForm.focus();
  }
  
  function showSource() {
      alert(hFormContent.body.innerHTML);
  }
</script>
<button onclick='insertImage()'>test</button>
<button onclick='showSource()'>show source</button>
<iframe id="MidasForm" src="about:blank" onload="test()">
</iframe>
</body>
</html>