本文介绍了试图将文本写入TinyMCE textarea中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图将文本写入 TinyMCE textarea 中。我有下面的代码。显示TinyMCE文本区域,但警报甚至没有显示。为什么?

 < html> 
< head>< / head>
< body>
< script type =text / javascriptsrc ='http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.js'>< / script>
< script type =text / javascriptsrc =/ home / javiergarcia / Scaricati / jari / tinymce / jscripts / tiny_mce / tiny_mce.js>< / script>
< script type =text / javascript>
tinyMCE.init({
mode:textareas,
});
$ b $(document).ready(function(){
$('form')。submit(function(){
// alert(fasdfs);
alert(tinyMCE.get('#jander')。getContent());
});
});
< / script>
< form method =postaction =somepage>
< input type =submit>
< / form>
< / body>
< / html>

问候



Javier

解决方案

为什么不简单地使用 tinymce.get('jander')。getContent(); (小包中的小蛋糕!)?

I'm trying to get the text written inside a TinyMCE textarea. I have the code below. The TinyMCE text area is showed but the alert is not even showed. Why?

<html>
    <head></head>
    <body>
        <script type="text/javascript" src='http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.js'></script>
        <script type="text/javascript" src="/home/javiergarcia/Scaricati/jari/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
        <script type="text/javascript">
            tinyMCE.init({
                mode : "textareas",
            });

            $(document).ready(function() {
                $('form').submit(function() {
                    //alert("fasdfs");
                    alert(tinyMCE.get('#jander').getContent());
                });
            });
        </script>
        <form method="post" action="somepage">
            <textarea name="content" id="jander" style="width:100%"></textarea>
            <input type="submit">
        </form>
    </body>
</html>

Regards

Javier

解决方案

Why don't you simply use tinymce.get('jander').getContent(); (tinymce in lowercases!) ?

这篇关于试图将文本写入TinyMCE textarea中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-30 21:25