简体   繁体   English

如何在bootstrap-wysiwyg中使用“更改事件”?

[英]How to use “change event” in bootstrap-wysiwyg?

I am using the bootstrap-wysiwyg. 我正在使用bootstrap-wysiwyg。

I need an event to occur after text is modified and the input box is blurred. 修改文本且输入框模糊后,我需要发生一个事件。

I saw the below code, but this isn't the event I want 我看到了下面的代码,但这不是我想要的事件

 // bind the event event
 $('#wysiwyg').wysiwyg('document').keypress(function(e) {

 // This will cancel the keypress
 e.preventDefault();

 // alert
 alert('Keypress detected!');
 });

I want an event to occur after text is modified and the input box is blurred. 我希望在修改文本并且输入框模糊后发生事件。

Event I want is similar to ".change()" in jQuery. 我想要的事件类似于jQuery中的“ .change()”。

I hope you help me.. thank you.. 希望你能帮我..谢谢

I know this is a question is a bit old, but here's how you can do it in case you still need to solve this issue in the future. 我知道这是一个有点老的问题,但是如果您将来仍然需要解决此问题,可以采用以下方法。 Assuming that you're using the latest version of bootstrap-wysiwyg you can do what you're wanting using the following code: 假设您使用的是最新版本的bootstrap-wysiwyg,则可以使用以下代码执行所需的操作:

$('#wysiwyg').wysiwyg().on('change', function()
{
    // You code goes here
});

You can download the latest version from here . 您可以从此处下载最新版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM