html5 显示%3cbr%3e,Bootstrap wysihtml5显示额外的字符串(Bootstrap wysihtml5 show extra strings)...

Bootstrap wysihtml5显示额外的字符串(Bootstrap wysihtml5 show extra strings)

我正在使用bootstrap-wysihtml5编辑器。 在我的网上它的工作好。 但是当我使用jquery将数据从它发送到php时,它会发送一些额外的数据。 例如:

当我寄这个:

product two

它发送如下:

product+two%3Cbr%3E

我的Bootstrap wysihtml5配置在这里:

$('#form').wysihtml5({

image: false

});

我的jquery ajax代码在这里:

$.ajax({

url: "index.php",

type: 'POST',

dataType: 'html',

data: {

contentEdit: $('#form').serialize()

},

success: function(data) {

alert('something ...');

}

});

避免这种情况的程序是什么?

I'm using bootstrap-wysihtml5 editor. On my web its working good. But when I send data from it to php using jquery it send some extra data. For example:

When I send this:

product two

It send the followings:

product+two%3Cbr%3E

My Bootstrap wysihtml5 configuration is here:

$('#form').wysihtml5({

image: false

});

And my jquery ajax code is here:

$.ajax({

url: "index.php",

type: 'POST',

dataType: 'html',

data: {

contentEdit: $('#form').serialize()

},

success: function(data) {

alert('something ...');

}

});

What is the procedure to avoid that?

原文:https://stackoverflow.com/questions/33199910

更新时间:2021-01-03 19:01

最满意答案

实际上问题是我在一个页面中使用了多个表单。 否则它在框架内工作,这意味着当我们集成Bootstrap wysihtml5时,它通过iframe嵌入。 最终我通过使用ckeditor解决了这个问题。 它更灵活,更易于使用。 要轻松使用它,您可以按照其API文档进行操作。 谢谢大家。

actually the problem was that I have used multiple form in one page. Otherwise it works within a framework that means when we integrate the Bootstrap wysihtml5, it's embedded through an iframe. Ultimately I have solved the problem by using ckeditor. It is more flexible and easy to use. To easily use it you can follow its API documentation. Thanks to all.

相关问答

只需设置实际textarea的宽度 textarea#my_id { width: 100% }

Just set a width of the actual textarea textarea#my_id { width: 100% }

我想出了一个修复: 1)在“/ watch”之前添加“/ v”解决了这个问题 我添加了一个更改网址的脚本: https://www.youtube.com/watch?v=OOHYCZLmbyc

至 https://www.youtube.com/v/watch?v=OOHYCZLmbyc

在我的上下文中我添加了这个: video.src = src["src"].replace("://www.youtube.com/watch", "://www.youtube.com/v/watch")

...

bootstrap-wysihtml5有一个events属性; 其中一个事件是load事件。 要在加载时调整textarea大小,您只需在textarea.wysihtml5配置函数中声明load事件 ; 见下面的代码: 码 textarea.wysihtml5({

...other properties....,

"events": {

"load": function() {

console.log("Loaded!");

var $iframe = $

...

我有同样的问题试图禁用/隐藏工具栏和编辑器,并运气好以下命令(禁用编辑器)。 我正在使用版本wysihtml5-0.3.0_rc2.js) $('#editorId').data('wysihtml5').editor.composer.disable();

$('#editorId').data('wysihtml5').editor.composer.enable();

或(隐藏编辑器) $('#editorId').data('wysihtml5').editor.composer.hid

...

如果您正在寻找一个简单的wysiwyg编辑器与淘汰赛的集成,我可以建议您使用以下库: ckeditor :当您安装此野兽时,请确保将所有内容添加到同一文件夹中并引用ckeditor.js(它有自己的scriptloader) 自定义淘汰赛绑定手: /*

Usage:

*/

(function (ko, CKEDITOR) {

ko.bindingHandlers.i

...

实际上问题是我在一个页面中使用了多个表单。 否则它在框架内工作,这意味着当我们集成Bootstrap wysihtml5时,它通过iframe嵌入。 最终我通过使用ckeditor解决了这个问题。 它更灵活,更易于使用。 要轻松使用它,您可以按照其API文档进行操作。 谢谢大家。 actually the problem was that I have used multiple form in one page. Otherwise it works within a framework tha

...

如果您想显示所有内容,因为它是在wysihtml5中输入的(但不是100%安全),而不是使用以下任何内容: = text.html_safe

= raw text

== text

如果您想使它绝对安全,那么使用: == sanitize text, tags: %w(em strong b i u a ...), attributes: %w(href title ...)

通过这种方式,您可以控制标记允许的标记和标记的允许属性。 If you would like to show every

...

你应该能够在下面使用相同的功能 $("#").wysihtml5();

window.describeEditor = window.editor;

然后你应该可以使用 describeEditor.setValue(c.DescrizioneBreve, true)

或使用 editorDescrizioneBreve.data("wysihtml5").editor.setValue(c.Descrizio

...

我回答了自己的问题。 不要试图在这些按钮上使用twitter bootstrap JS,最好使用wysihtml5 JS行为,它将类wysihtml5-command-active到任何活动按钮。 因此,要设置这些按钮的样式,您需要添加reset.css文件,以下是以下CSS: .wysihtml5-action-active, .wysihtml5-command-dialog-opened,

.wysihtml5-command-active {

box-shadow: inset 0 1

...

如果你看看wysihtml5 github页面,你会发现它支持IE8 +( https://github.com/xing/wysihtml5#browser-support )。 因此不支持IE7。 它会优雅地降级,因此IE7和IE6用户可以编辑纯HTML。 您可以使用支持IE7的其他编辑器,例如CKEditor ( 支持IE6 + ) If you take a look at the wysihtml5 github page, you'll find that it supports IE

...

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值