0

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"

何か案が?

4

3 に答える 3

4

この問題を次のように解決します。

$(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))
于 2014-09-12T04:46:38.497 に答える
4

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-08-20T08:16:48.703 に答える