YUI 文本编辑器在我的 Mozilla 中无法工作

发布于 2024-08-08 07:29:13 字数 3470 浏览 4 评论 0原文

我已经遇到这个问题几个小时了,真的不知道如何解决这个问题。然而,它在 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;
        }  //} 

}

请任何人都可以帮助我我做错了什么。

提前致谢。

I am experiencing this problem for few hours now and really not sure how to solve this. However its work fine in IE but it is not working in mozilla.
Here is my code:

   <!-- 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;
        }  //} 

}

Please can anyone help me what iam doing wrong..

Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

苍白女子 2024-08-15 07:29:13

我刚刚在我的 Mac 上尝试了 Firefox,一切似乎都正常。你的问题到底是什么?

i've just tried on my mac with firefox and everything seems to work. What's exactly your problem ?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文