【问题标题】:TinyMCE Not Rendering in BrowserTinyMCE 不在浏览器中渲染
【发布时间】:2013-03-04 09:59:43
【问题描述】:

大家好,我正在为我的新社交网络构建一个博客系统,并且正在使用 TinyMCE 来写帖子!出于某种原因,它没有出现,也不知道为什么!

我已经从他们的网站下载了这个包并将它上传到我的服务器,并创建了一个名为 blog_writer.php 的页面,其中包含以下内容:

这是包含我的文本区域的表单:

<form method="post" action="blog_writer.php">
  <div id="blogMsg"><?php echo $msg; ?></div>
  <div id="blogTitle">
  Choose a topic:
  <select name="topic">
  <option value="  ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</option>
  <?php 
  $sql = "SELECT id,name FROM blog_topics ORDER BY name";
  $query = mysqli_query($db_conx, $sql) or die (mysqli_error());
  while($row = mysqli_fetch_array($query)){
      echo '<option value="' . $option[id] . '">' . $option[name] . '</option>';
  }?>

  </select>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  Enter a title:
  <input name="title" type="text" size="80" value="<?php echo $title; ?>" />
  </div>
  <div id="blogContent"><textarea name="blog" id="blog" cols="80" rows="25" class="tinymce"><?php echo $blog; ?></textarea>
  <br/><br/>
  <input type="submit" name="submit" id="submit" value="Publish Blog Post">
  <br/><br/>
  </div>
  <div class="blogClear"></div>
</form>

这是我在页面上使用的 javascript,用于引入文本编辑器并替换我的 textarea:

<script src="js/javascript-1.9.1.js" type="text/javascript"></script>
<script src="tiny_mce/jquery.tinymce.js"></script>
<script>
$().ready(function() {
    $('textarea.tinymce').tinymce({
        script_url : 'tiny_mce/tiny_mce.js',
        theme : "advanced",
        plugins : "autolink,lists,inlinepopups,paste,noneeditable,nonebreaking",
        theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
            theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
            theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
            theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak",
            theme_advanced_toolbar_location : "top",
            theme_advanced_toolbar_align : "left",
            theme_advanced_statusbar_location : "bottom",
            theme_advanced_resizing : true,
    });
});
</script>

据我所见,通过将我的页面与他们在下载中提供的示例页面进行比较,应该有一些显示 uo!但我现在得到的只是一个空白页!

非常感谢各位!

菲利普·杜斯

【问题讨论】:

  • 只是一个快速的猜测,删除 theme_advanced_resizing 之后的最后一个逗号:true。尤其是 IE 不喜欢这个。
  • 没什么,和他们在下载中提供给你的示例页面一样,但我确实试过了!

标签: tinymce wysiwyg text-editor


【解决方案1】:

您可以尝试为您的 textarea 提供一个类并将其添加到您的 tinymce 配置中

mode:'exact',
elements : "your_textarea_class",

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-10-24
    • 2020-04-27
    • 1970-01-01
    • 1970-01-01
    • 2016-08-06
    相关资源
    最近更新 更多