1

大家好,我正在为我的新社交网络构建一个博客系统,并且正在使用 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!但我现在得到的只是一个空白页!

非常感谢你们!

菲利普·杜斯

4

1 回答 1

0

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

mode:'exact',
elements : "your_textarea_class",
于 2013-03-04T10:14:42.113 回答