在php中我們經常會使用各種編輯器,下面我來介紹在PHP網頁中Ewebeditor編輯器嵌入代碼,各位同學可參考.
下載“Ewebeditor”PHP編輯器
在 </head> 之前加上下面一段代碼:
- <script>
- function checkForm()
- {
- document.form1.content .value = window.ewebeditor .getHTML();
- ************getHTML() 獲得編輯區內容
- ************ 此處的名字 ewebeditor 要與 iframe 中的 name="ewebeditor" 相同
- ************content.value 也要與 content 中的 <input > 中相對應
- }
- </script>
下面一段代碼是把 ewebeditor 嵌入到網頁中:
- <input type="hidden" name="content" id="content" value ="">
- **********id="content" 中的 content 要與 <iframe> 中的 id=content 相同!
- <iframe id="ewebeditor" name="ewebeditor" src="ewebeditor/ewebeditor.php?id=content " frameborder="0" scrolling="no" width="100%" HEIGHT="450">
- </iframe>
新聞熱點
疑難解答