Skip to content

Instantly share code, notes, and snippets.

@bgkittrell
Created December 23, 2010 13:12
Show Gist options
  • Save bgkittrell/752955 to your computer and use it in GitHub Desktop.
Save bgkittrell/752955 to your computer and use it in GitHub Desktop.
<html>
<head>
<!-- Skin CSS file -->
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.8.2r1/build/assets/skins/sam/skin.css">
<!-- Utility Dependencies -->
<script src="http://yui.yahooapis.com/2.8.2r1/build/yahoo-dom-event/yahoo-dom-event.js"></script>
<script src="http://yui.yahooapis.com/2.8.2r1/build/element/element-min.js"></script>
<!-- Needed for Menus, Buttons and Overlays used in the Toolbar -->
<script src="http://yui.yahooapis.com/2.8.2r1/build/container/container_core-min.js"></script>
<!-- Source file for Rich Text Editor-->
<script src="http://yui.yahooapis.com/2.8.2r1/build/editor/simpleeditor-min.js"></script>
</head>
<body class="yui-skin-sam">
<input>
<script>
function loadEditor() {
var olddiv = document.getElementById('container');
if (olddiv)
document.body.removeChild(olddiv);
var div = document.createElement('div');
div.id = 'container';
var ta = document.createElement('textarea');
ta.id = 'content';
div.appendChild(ta);
document.body.appendChild(div);
var myEditor = new YAHOO.widget.SimpleEditor('content', {
height: '300px',
width: '522px',
dompath: true //Turns on the bar at the bottom
});
myEditor.render();
}
</script>
<a href="#" onclick="loadEditor()">Load Editor</a>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment