我正在尝试提供bootstrap-wysiwyg编辑器。它在firefox中运行良好,但在IE中出现异常
Unhandled exception at line 30, column 7 in http://localhost:21585/Scripts/plugins/bootstrap-wysiwyg.js
0x80040100 - JavaScript runtime error: This command is not supported.这条线是
if (document.queryCommandState(command)) {命令= "fontSize 5“
有什么想法吗?
发布于 2014-08-20 16:16:49
由于IE不能处理"fontSize 5“,你必须删除"5”。
因此,在bootstrap-wysiwyg.js中找到以下行
var command = $(this).data(options.commandRole);
if (document.queryCommandState(command)) {并将其更改为如下所示
var command = $(this).data(options.commandRole);
command = command.split(' ').shift();
if (document.queryCommandState(command)) {发布于 2014-09-12 12:46:38
我解决这个问题的方法如下:
$(options.toolbarSelector).find(toolbarBtnSelector).each(function () {
var command = $(this).data(options.commandRole);
if (document.queryCommandState(command)) {更改此行:
if (document.queryCommandState(command))至:
if (editor.is(':focus') && document.queryCommandState(command))发布于 2013-09-23 19:35:11
https://stackoverflow.com/questions/18958185
复制相似问题