# 定義 debug 模式
可通過`editor.customConfig.debug = true`配置`debug`模式,`debug`模式下,有 JS 錯誤會以`throw Error`方式提示出來。默認值為`false`,即不會拋出異常。
但是,在實際開發中不建議直接定義為`true`或者`false`,可通過 url 參數進行干預,示例如下:
```html
<div id="div1">
<p>歡迎使用 wangEditor 富文本編輯器</p>
</div>
<script type="text/javascript" src="/wangEditor.min.js"></script>
<script type="text/javascript">
var E = window.wangEditor
var editor = new E('#div1')
// 通過 url 參數配置 debug 模式。url 中帶有 wangeditor_debug_mode=1 才會開啟 debug 模式
editor.customConfig.debug = location.href.indexOf('wangeditor_debug_mode=1') > 0
editor.create()
</script>
```
- 介紹
- 開始使用
- 創建一個編輯器
- 使用JS模塊定義
- 菜單和編輯區域分離
- 單頁面多個編輯器
- 禁用編輯器
- 內容處理
- 設置內容
- 獲取內容
- 使用textarea
- 獲取JSON
- 參數配置
- 配置菜單
- debug模式
- onchange
- 配置編輯區域z-index
- 多語言
- 粘貼文本
- 插入網絡圖片回調
- 插入鏈接的校驗
- 插入網絡圖片的校驗
- onfocus
- onblur
- 配置顏色
- 配置表情
- 配置字體
- 上傳圖片
- tab顯示和隱藏
- base64格式保存圖片
- 上傳圖片到服務器
- 上傳到七牛云存儲
- 其他
- 全屏-預覽-查看源碼
- 上傳附件
- 關于markdown
- xss攻擊
- 用于React
- 用于Vue
- 用于angular
- 常用API