在ckeditor官網(wǎng)下載ckeditor后 解壓縮,,放到網(wǎng)站根目錄下 下面演示三種調(diào)用ckeditor的方法 1.通過html,,js調(diào)用ckeditor <html> <head> <title>Sample CKEditor Site</title> <script type="text/javascript" src="ckeditor/ckeditor.js"></script> </head> <body> <form method="post"> <p> My Editor:<br /> <textarea id="editor1" name="editor1"><p>Initial value.</p></textarea> <script type="text/javascript"> CKEDITOR.replace( 'editor1' ); </script> </p> <p> <input type="submit" /> </p> </form> </body> </html> 2.使用php調(diào)用ckeditor <p>Title:</p><input name="subject" type="text" > <?php include 'ckeditor/ckeditor.php'; $ckeditor = new CKEditor; $ckeditor->editor('content'); ?> <input name="submit" type="submit" value="提交" /> 3.使用textarea和js調(diào)用ckeditor <html> <head> <title>Sample CKEditor Site</title> <script type="text/javascript" src="ckeditor/ckeditor.js"></script> <script type="text/javascript"> window.onload = function() { CKEDITOR.replace( 'content' ); //content是textarea的名稱 }; </script> </head> <body> <form method="post"> <p> My Editor:<br /> <input type="text" name="title"> <textarea name="content"></textarea> </p> <p> <input type="submit" name="sub"/> </p> </form> </body> </html> 轉(zhuǎn)載請注明出處:IT技術(shù)學(xué)習(xí)網(wǎng) http://www./php/php_ckeditor.html |
|