English 中文(简体)
FCKeditor 没有在铬浏览器中将数据保存到数据库中
原标题:FCKeditor is not saving data into database in Chrome Browser

我在Mozilla 工作非常出色。 但是它没有将文本保存到 Chrome 浏览器的数据库中。 我正从php 发送数据到$, ajax 方法。 这是 PHP 文件的代码 :

<div class="post_content"> Post Content <?

                                                        $sBasePath = $_SERVER[ PHP_SELF ] ;
                                                        $sBasePath = "fckeditor/";

                                                        $oFCKeditor = new FCKeditor( FCKeditor1 ) ;
                                                        $oFCKeditor->Height =  400  ;
                                                        $oFCKeditor->BasePath   = $sBasePath ;
                                                        $oFCKeditor->Value      =   ;
                                                        $oFCKeditor->Create(); 
                                                        ?>
                           </div>

这是我的笔记本:

$(document).ready(function(){

            $("#add_new_post").submit(function() {

                var FCKGetInstance = FCKeditorAPI.GetInstance( FCKeditor1 ); 

                var getText = FCKGetInstance.EditorDocument.body.innerHTML; 
                var StripTag = getText.replace(/(<([^>]+)>)/ig,"");


                var dataString =  FCKeditor1= + getText;


                        if(StripTag==  )
                         {
                            alert( Please enter Post Content . );

                         } else {
                             //alert(dataString);
                                $.ajax({
                                        type: "POST",
                                        url: "ajax_add_new_blog_post.php",
                                        data: dataString,
                                        cache: false,
                                        success: function(html){

                                                $("body").showMessage({

                                                       thisMessage :    [html],

                                                       autoClose :  true,

                                                       className :   tooltip ,

                                                       delayTime :  8000,

                                                       displayNavigation :  false

                                                  });

                                                      setTimeout(function() {
                                                      window.history.back();

                                                  }, 3000);

                                        } 

                                    });

                             }

                    return false;

                    }); 

    });

以下是我的ajax_add_ new_blog_pos.php 代码:

$pagedetail = RTESafe($_REQUEST[ FCKeditor1 ]);

                        $str="INSERT INTO posts set


                        post_text= ".mysql_real_escape_string($pagedetail)." ";



                        $success = mysql_query($str);

                        if($success){

                                echo  You have added post successfully! ;

                            }else{

                                echo  Adding post was not successful. Try again ;
                            }

function RTESafe($strText) {

     $tmpString = trim($strText);

     $tmpString = str_replace(chr(145), chr(39), $tmpString);

     $tmpString = str_replace(chr(146), chr(39), $tmpString);

     $tmpString = str_replace(" ", "&#39;", $tmpString);

     $tmpString = str_replace(chr(147), chr(34), $tmpString);

     $tmpString = str_replace(chr(148), chr(34), $tmpString);

     $tmpString = str_replace(chr(10), " ", $tmpString);

     $tmpString = str_replace(chr(13), " ", $tmpString);

     return $tmpString;

}
问题回答

我猜测是使用 < a href=> "http://ckeditor.com/ download" rel="nofollow" >CKeditor ,如果可能的话。 FCKeditor 已过时 。





相关问题
jQuery redirect not working in non-IE browsers

I m trying to redirect all links to a particular page on our site to a secure connection using jQuery. This code works fine in IE, but it doesn t work in any other browser (tried it in Chrome, Firefox,...

Browser-friendly way to simulate anchor click with jQuery?

I m trying to simulate a click on an anchor tag using jQuery. I ve been digging around StackOverflow and Google for a while and haven t found anything that works on all of the browsers I m testing. So ...

Widescreen check on normal screen

I work normal screen and I develop some web application. When the application goes on widescreen some of the pages looks weired. Is there any way I can view my web page as it looks in Widescreen on my ...

Cross-browser development

I m developing a web application for a new service, starting from Firefox 3.5. The interface design is tableless, only using divs + CSS & performance-blessed practices. Now, while being ...

热门标签