YUI文本编辑器在我的Mozilla中不起作用

时间:2009-10-24 02:26:40

标签: php yui

我现在遇到这个问题几个小时了,真的不知道如何解决这个问题。然而它在IE中的工作正常,但它不适用于Mozilla。 这是我的代码:

   <!-- Skin CSS file -->
    <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.7.0/build/assets/skins/sam/skin.css">
    <!-- Utility Dependencies -->
    <script type="text/javascript" src="http://yui.yahooapis.com/2.7.0/build/yahoo-dom-event/yahoo-dom-event.js"></script> 
    <script type="text/javascript" src="http://yui.yahooapis.com/2.7.0/build/element/element-min.js"></script> 
    <!-- Needed for Menus, Buttons and Overlays used in the Toolbar -->
    <script src="http://yui.yahooapis.com/2.7.0/build/container/container_core-min.js"></script>
    <script src="http://yui.yahooapis.com/2.7.0/build/menu/menu-min.js"></script>
    <script src="http://yui.yahooapis.com/2.7.0/build/button/button-min.js"></script>
    <!-- Source file for Rich Text Editor-->
    <script src="http://yui.yahooapis.com/2.7.0/build/editor/editor-min.js"></script>
    <script>
           var myEditor = new YAHOO.widget.Editor('msgpost', {
        height: '100px',
        width: '522px',
        dompath: true, //Turns on the bar at the bottom
        animate: true //Animates the opening, closing and moving of Editor windows
    });
    myEditor.render(); 
    //Inside an event handler after the Editor is rendered
    YAHOO.util.Event.on('save', 'click', function() {
        //Put the HTML back into the text area
        myEditor.saveHTML();

        //The var html will now have the contents of the textarea
        var html = myEditor.get('msgpost').value;
    });
    YAHOO.util.Event.on('edit', 'click', function() {
        //Put the HTML back into the text area
        myEditor.saveHTML();

        //The var html will now have the contents of the textarea
        var html = myEditor.get('msgpost').value;
    });



        </script> 

    <form id="form2" name="form2" method="post" action="processgreeting.php">

     <div class="span-22 gtype"  >
     <div class="span-5"><label>Message:</label></div>
     <div class="span-17 last"><textarea name="msgpost" id="msgpost" cols="50" rows="40"> </textarea> <br>  
     </div>

    <input type="submit" name="save" value="Post Greeting"  id="postgreeting"/>

    </form>

processgreeting.php
if(isset($_POST['save']))
{

 $body = trim($_POST['msgpost']);

  $valid = 1;
  $publish_date = strtotime($publish); 
   if ($publish >= $today)
    {
    $valid = 0;
    $insert_greeting = "INSERT INTO greeting (type,decs,name,message,date,user,publish) VALUES ('$type','$desc','$name','$body','$today',$user,'$publish')";
    $register_greeting = mysql_query($insert_greeting)or die(mysql_error());
    $lastnum = mysql_insert_id(); 
    $_SESSION["greetingno"] = $lastnum; 
    if($valid == 0)
    {
    echo '<strong>Greeting Type: </strong>'.$type.'<br><strong>Description: </strong>'.$desc.'<br><strong>Name: </strong>'.$name.'<br><strong>Message: </strong>'.$body.'<strong><br>Publish Date: </strong>'.$publish;
    }

    //echo $valid;
    }
   else{ //echo "<span style='color:#FF0000'>Publish date is invalid</span>" ;
   echo $valid;
        }  //} 

}

任何人都可以帮助我,我做错了什么..

提前致谢。

1 个答案:

答案 0 :(得分:0)

我刚刚使用firefox试用了我的mac,一切似乎都有效。你的问题究竟是什么?