I am trying to provide bootstrap-wysiwyg editor. It works fine in firefox but in IE I am getting exception
Unhandled exception at line 30, column 7 in http://localhost:21585/Scripts/plugins/bootstrap-wysiwyg.js
0x80040100 - JavaScript runtime error: This mand is not supported.
The line is
if (document.queryCommandState(mand)) {
mand = "fontSize 5"
Any idea?
I am trying to provide bootstrap-wysiwyg editor. It works fine in firefox but in IE I am getting exception
Unhandled exception at line 30, column 7 in http://localhost:21585/Scripts/plugins/bootstrap-wysiwyg.js
0x80040100 - JavaScript runtime error: This mand is not supported.
The line is
if (document.queryCommandState(mand)) {
mand = "fontSize 5"
Any idea?
Share Improve this question edited Feb 19, 2014 at 18:14 Sterling Archer 22.4k19 gold badges85 silver badges121 bronze badges asked Sep 23, 2013 at 11:32 Rao EhsanRao Ehsan 7768 silver badges15 bronze badges3 Answers
Reset to default 4Since IE can't handle "fontSize 5" you have to remove the "5".
So locate the following lines in bootstrap-wysiwyg.js
var mand = $(this).data(options.mandRole);
if (document.queryCommandState(mand)) {
and change it to look like this
var mand = $(this).data(options.mandRole);
mand = mand.split(' ').shift();
if (document.queryCommandState(mand)) {
I resolve this issue as below: find:
$(options.toolbarSelector).find(toolbarBtnSelector).each(function () {
var mand = $(this).data(options.mandRole);
if (document.queryCommandState(mand)) {
change this line:
if (document.queryCommandState(mand))
to:
if (editor.is(':focus') && document.queryCommandState(mand))
As the error suggests, "fontSize 5" is not a valid mand name. Use "fontSize" instead.
References:
- MSDN
- MDN (Mozilla)