1. 程式人生 > >如何使用第三方編輯器給網頁新增編輯器?

如何使用第三方編輯器給網頁新增編輯器?

首先下載CKEditor:

http://ckeditor.com/download

一、解壓並複製CKEditor到專案WebRoot中()

二、在頁面中引入CKEditor:

1.<scripttype="text/javascript" src="<%=request.getContextPath()%>/ckeditor/ckeditor.js"> </script>

2.在“內容”textarea標籤中加入class="ckeditor"

引入後就可以使用CKEditor編輯新聞的內容了

編輯好新聞內容後,就可以提交到doAdd.jsp,把新聞存入資料庫中