Reputation: 469
i want to add an editor(see pic http://img8.imageshack.us/img8/7664/editorw.jpg attach) to a my webpage. How can i do that?!
Upvotes: 0
Views: 1157
Reputation: 27323
the editor you have in your screenshot is somekind of FCK Editor. you can download CKEditor (the new version of FCKEditor) and use the following code to create an editor in your pages:
<script type="text/javascript" src="ckeditor.js"></script>
<textarea cols="80" id="editor2" name="editor2" rows="10"><p>This is some <strong>sample text</strong>. You are using <a
href="http://www.fckeditor.net/">CKEditor</a>.</p></textarea>
<script type="text/javascript">
//<![CDATA[
// This call can be placed at any point after the
// <textarea>, or inside a <head><script> in a
// window.onload event handler.
// Replace the <textarea id="editor"> with an CKEditor
// instance, using default configurations.
CKEDITOR.replace( 'editor2' );
//]]>
</script>
make sure you include the valid path to ckeditor.js
also you can consult the documentation for more details.
Also make sure you have cleaning code for user input (like white list of tags) because if you don't your site is going to be vunerable to XSS attacks.
Upvotes: 1