sách gpt4 ăn đã đi

jquery - 编辑器:模糊事件导致错误

In lại Tác giả: Walker 123 更新时间:2023-11-30 23:51:04 31 4
mua khóa gpt4 giày nike

我正在 Laravel 项目上使用 redactor 作为文本编辑器。

每当编辑器位于页面上并初始化时,每当我单击任意位置时都会收到此错误。

Uncaught TypeError: $(...).closest(...).size is not a function(…)  
Uncaught TypeError: $current.closest(...).size is not a function(…)

每当我在编辑器中键入内容或单击页面上的任意位置时,都会触发此操作。编辑器初始化正常,并且工作正常。我不知道为什么它会提示模糊事件。

这就是我初始化它的方式:

$('#myInput').redactor({
'buttons': ['html', 'formatting', 'bold', 'italic', 'unorderedlist', 'orderedlist', 'link'],
'placeholder': 'Comments...'
});

看起来这是令人不满意的部分之一:

$(document).on('mousedown.redactor-blur.'+this.uuid,

我正在使用 Redactor 10.2.5

谢谢您的建议!

câu trả lời hay nhất

我正在使用 Redactor 10.2.2,但升级 jquery 版本(2.x -> 3.x)后出现类似错误。

我认为与 jquery 版本 3 和以下 2 行存在一些冲突:

line 1463: if ($(e.target).closest('.redactor-editor, .redactor-toolbar, .redactor-dropdown').size() !== 0)
line 6913: if ($current.closest(element).size() > 0)

应该修改

line 1463: if ($(e.target).closest('.redactor-editor, .redactor-toolbar, .redactor-dropdown').length !== 0)
line 6913: if ($current.closest(element).length > 0)

适用于 Reactor 10.2.5。

希望这对您有帮助。

关于jquery - 编辑器:模糊事件导致错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40434017/

31 4 0
Walker 123
Hồ sơ

Tôi là một lập trình viên xuất sắc, rất giỏi!

Nhận phiếu giảm giá taxi Didi miễn phí
Phiếu giảm giá taxi Didi
Chứng chỉ ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com
Xem sitemap của VNExpress