javascript - TinyMCE 删除了我的代码并更改了我的 html,但没有一个解决方案有效

标签 javascript asp.net tinymce tinymce-4 html-editor

我正在使用 Tiny MCE 编辑器,当我保存 html 文本时,它会自动删除我的内容,我已经在不同的论坛上查看了许多解决方案,但没有一个解决此问题。

<!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>  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />  <title>Receipt Creation Failure</title>  </head>    <body style="font-family:Arial, Helvetica, sans-serif; font-size:12px; color:#333;">  <div style="border:1px; border-color:#003; border-style:solid; width:600px; float:left">        <div style="float:left; padding-top:20px; width:560px; padding:20px; min-height:200px; "> <strong>Dear Team, </strong><br />      <br />    There was a payment attempt from the Test named <b>{TestName}</b> placed at <b>{TestLocation}</b>. <br This is a system generated message, please do not reply to this email address since it is not monitored.<br />      <br />      <strong>Thank you <br />      xyz Support Team </strong></div>    <div style="width:580px; padding:10px; background-color:#132c4d; height:10px; text-align:right; clear:both; color:#FFF; text-decoration:none"><a style="color:#FFF; text-decoration:none;" href="https://emaar.service-now.com/" target="_blank">Contact Us</a> | <a href="http://xyz.ae/" target="_blank" style=" color:#FFF; text-decoration:none;">xyz.ae</a></div>  </div>  </body>  </html>

当我保存此信息时,它会将其转换为

<p>Receipt Creation Failure</p>
<div style="border: 1px; border-color: #003; border-style: solid; width: 600px; float: left;">
<div style="float: left; padding-top: 20px; width: 560px; padding: 20px; min-height: 200px;"><strong>Dear Team, </strong><br /> <br /> There was a payment attempt from the Test named <strong>{TestName}</strong> placed at <strong>{TestLocation}</strong>. <br /> <br /> <strong>Thank you <br /> xyz Support Team </strong></div>
<div style="width: 580px; padding: 10px; background-color: #132c4d; height: 10px; text-align: right; clear: both; color: #fff; text-decoration: none;"><a style="color: #fff; text-decoration: none;" href="https://emaar.service-now.com/" target="_blank">Contact Us</a> | <a style="color: #fff; text-decoration: none;" href="http://xyz.ae/" target="_blank">xyz.ae</a></div>
</div>

请帮忙。

最佳答案

您尝试过 tinyMCE.activeEditor.getContent({format : 'raw'}); 吗?

关于javascript - TinyMCE 删除了我的代码并更改了我的 html,但没有一个解决方案有效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46036381/

相关文章:

javascript - 通过 REST API 在 BlockBlob 上设置 Azure 元数据

javascript - 如何在 JavaScript 中使用大数组

javascript - 如何在 ASP.NET 文字控件中动态显示图像

c# - 从代码隐藏(或前端)设置 mailto

javascript - 绑定(bind)多个事件

javascript - 下拉子菜单中的彩色字体

javascript - 从 aspx 页面中的 usercontrol 访问一个 id

javascript - Requirejs 出现 knockout 错误 : Unable to process binding "component: function (){return f}" - Mismatched anonymous defined() module

ASP.NET MVC - 检查请求是否来自另一个操作

jquery - position absolute contenteditable 长内容问题