问题
I am trying to determine if the execCommand('undo') can be executed.
I've tried this one:
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.
Is there another way to see if 'undo' is executable ?
Thanks in advance!
回答1:
- 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
(yes, Midas is based on IE interfaces)
来源:https://stackoverflow.com/questions/5062526/is-there-a-way-to-determine-if-execcommandundo-is-executable-javascript