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);

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值