有没有一种方法可以确定execCommand('undo')是否可执行? [JavaScript] [英] Is there a way to determine if execCommand('undo') is executable? [JavaScript]
本文介绍了有没有一种方法可以确定execCommand('undo')是否可执行? [JavaScript]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试确定execCommand('undo')是否可以执行.
I am trying to determine if the execCommand('undo') can be executed.
我已经尝试过这个:
if(document.execCommand('undo'))
{
document.execCommand('redo');
// some code
}
它可以工作...但是这使我在脚本的其他部分遇到了一些问题.
and it works... But it makes me some problems with the other part of the script.
还有另一种方法来查看撤消"是否可执行吗?
提前谢谢!
推荐答案
- document.queryCommandSupported http://msdn.microsoft.com/en-us/library/ms536681(VS.85).aspx
- document.queryCommandEnabled http://msdn.microsoft.com/en-us/library/ms536676(VS.85).aspx
- document.queryCommandSupported http://msdn.microsoft.com/en-us/library/ms536681(VS.85).aspx
- document.queryCommandEnabled http://msdn.microsoft.com/en-us/library/ms536676(VS.85).aspx
(是的,Midas基于IE接口)
(yes, Midas is based on IE interfaces)
这篇关于有没有一种方法可以确定execCommand('undo')是否可执行? [JavaScript]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文