首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >读取ckeditor内容

读取ckeditor内容
EN

Stack Overflow用户
提问于 2013-01-28 18:14:59
回答 1查看 1.2K关注 0票数 2

我在我的asp.net页面中使用CKEditor。为此,我将ckeditor.dll添加到我的项目中。我在.aspx页面中使用了这个引用。我的问题是我无法读取javascipt中的ckeditor内容。有谁能告诉我如何做到这一点。以下是我的代码

代码语言:javascript
复制
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="CKEditorVamshi._Default" %>
<%@ Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <script src="Scripts/jquery-1.4.1.js" type="text/javascript"></script>
    <script type="text/javascript" language="javascript">
        function validate() {
            var text = $('#cke_<%= CKEditorGettingStarted.ClientID %> iframe').contents().find('body').html();
           alert(text);
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <CKEditor:CKEditorControl AutoPostBack="True" ID="CKEditorGettingStarted" runat="server"
    Height="300px" BasePath="~/CKEditor" MaxLength="10" Width="100%" CausesValidation="true">
 </CKEditor:CKEditorControl>
 <br />
 <input type="button" id="btnPreview" value="Preview" onclick="validate();" />
    </form>
</body>
</html>

提前谢谢你

EN

回答 1

Stack Overflow用户

发布于 2013-01-28 19:08:37

试一试

CKEDITOR.instances.Your_Editor_Client_ID.getData();

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14559764

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档