利用Fck的javascript-API创建fck编辑器

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>  
    <script type="text/javascript" src="../fckeditor/fckeditor.js"></script>
    <title>fck示例</title>
</head>
<body>
<textarea id="fckInstance" cols="100" name="fckInstance">sasdfasdfadsfadsf</textarea>
<br/>注意:id或name为fckInstance的textarea一定要放在script之前,否则fck的API会报找不到id或name名为fckInstance的textarea
<script type="text/javascript">
    var fckobj = new FCKeditor('fckInstance', 600, 350);
        fckobj.ToolbarSet = 'Default';
        fckobj.ReplaceTextarea();  
</script>
</body>
</html>

你可能感兴趣的:(JavaScript)