2016-11-06 147 views

回答

0

類 'theEditor' 添加到您的文字區域。

<textarea class=」theEditor」 name=’blurb’ id=’blurb’></textarea> 

編輯:

你也可以用JS

<script type="text/javascript"> 
jQuery(document).ready(function() { 
    jQuery("#blurb").addClass("mceEditor"); 
    if (typeof(tinyMCE) == "object" && 
     typeof(tinyMCE.execCommand) == "function") { 
     tinyMCE.execCommand("mceAddControl", false, "blurb"); 
    } 
}); 
</script> 

<textarea class="" name='blurb' id='blurb'></textarea> 
+0

你需要使用''「''不''」''或''」'' – jmattheis

+0

不工作!@parthmahida –

+0

我已經更新了答案@robertchan –

0

也許你正在使用TinyMCE的較新版本中添加編輯器。變化

tinyMCE.execCommand("mceAddControl", false, "blurb"); 

tinyMCE.execCommand("mceAddEditor", false, "blurb");