`
kongxiantao
  • 浏览: 108073 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

execCommand

阅读更多

 

mozilla 文档地址:https://developer.mozilla.org/en/Rich-Text_Editing_in_Mozilla#Executing_Commands

 

msdn 文档地址:

 

http://msdn.microsoft.com/en-us/library/aa752577(v=VS.85).aspx

 

http://msdn.microsoft.com/en-us/library/ms533049(v=VS.85).aspx

 

 

mozllia

 

execCommand(String aCommandName, Boolean aShowDefaultUI, String aValueArgument)

 

Arguments

 

String aCommandName:the name of the command

 

Boolean aShowDefaultUI:

whether the default user interface should be shown. This is not implemented in Mozilla.

 

String aValueArgument:some commands (such as insertimage) require an extra value argument (the image's url). Pass an argument of null if no argument is needed.

 

 

msdn

 

 

HRESULT execCommand(

    BSTR cmdID,

    VARIANT_BOOL showUI,

    VARIANT value,

    VARIANT_BOOL *pfRet

);

 

cmdID:[in] BSTR that specifies the command to execute. This command can be any of the command identifiers that can be executed in script.

 

showUI:[in] VARIANT_BOOL that specifies one of the following values.

VARIANT_FALSE:Default. Do not display a user interface. Must be combined with value, if the command requires a value.

VARIANT_TRUE:Display a user interface if the command supports one.

 

value:[in] VARIANT that specifies the string, number, or other value to assign. Possible values and possible VARIANT subtypes depend on the command.

 

pfRet:[out, retval] Pointer to a VARIANT_BOOL that returnsVARIANT_TRUE if the command is successful.

 

 

 

结论:

 

document.execCommand(cmd, false, value);

 

  • 大小: 12.2 KB
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics