日期:2014-05-16  浏览次数:20686 次

~~~~~~~~~~~~~百度编辑器ueditor通过ajax提交报错!马上给分!~~~~~~~~~~~~~~~

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="CSPMSWeb.Test.WebForm1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="/css/index_skin01.css" rel="stylesheet" type="text/css" id="indexSkin" />
    <title>330CPS TEST</title>
</head>
<body>
  <div id="editor"></div>
  <div class="mt_10 center">
    <input class="btnsave mr_20" type="button" onclick="SaveInfo('save')" value="保存" />
  </div>
</body>
<script type="text/javascript" src="/js/jquery/jquery.1.7.1.min.js"></script>
<script type="text/javascript" src="/js/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="/js/ueditor/ueditor.all.js"></script>
<script language="javascript">
var editorhtml;
//实例化编辑器
UE.getEditor('editor');

function SaveInfo(state){   
    getContent();         //获取带格式的富文本内容
    alert(editorhtml);
    $.ajax({            
            url: "WebForm1.aspx",            
            data:
            {
                act: state,                                 
                content: editorhtml
            },
            success: function(data) {    
                alert("保存成功!"); 
            },
            error: function(data){
              alert("Save Func Error!");
            }
        });        
}

function getContent() {
    var arr = [];
    arr.push(UE.getEditor('editor').getContent());
    editorhtml=arr.join("\n")
}
</script>
</html>




做了一个最简单的WebForm1.aspx页面,然后在百度编辑