ckeditor使用

參考:https://www.jb51.net/article/86500.htm
https://www.cnblogs.com/Tirisfal/p/5548424.html
#### 注意用標準版的沒有背景色文字顏色等功能,因此配置了toolbar也不會顯示此功能,須要下載full版本

{% load staticfiles %}

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
{#    <script type="text/javascript" src="/static/ckeditor/ckeditor.js"></script>#}
    <script type="text/javascript" src="{% static 'ckeditor/ckeditor.js' %}"></script>
    <script type="text/javascript" src="{% static 'ckeditor/config.js' %}"></script>
{#    <script src="//cdn.ckeditor.com/4.4.6/full/ckeditor.js"></script>#}
</head>

<body>
<form action="">
    <textarea id="TextArea1" cols="20" name="ss" rows="2" class="ckeditor"></textarea>
    
    <script type="text/javascript">
           
    CKEDITOR.replace('TextArea1',
    { toolbar:'Basic', height:300,width:1000 });
    //若是是在ASP.NET環境下用的服務器端控 件<TextBox>
    //CKEDITOR.replace('tbContent');
    //如 果<TextBox>控件在母版頁中,要這樣寫
    //CKEDITOR.replace('<%=tbContent.ClientID.Replace("_","$") %>');
              
</script>
    <input type="submit">
</form>
</body>
</html>
相關文章
相關標籤/搜索