调用IHTMLElement::insertAdjacentHTML插入HTML

 

virtual /* [id] */ HRESULT STDMETHODCALLTYPE insertAdjacentHTML(
/* [in] */ __RPC__in BSTR where,
/* [in] */ __RPC__in BSTR html) = 0;

可用的where:

beforeBegin

afterBegin

beforeEnd

afterEnd

 

特别要注意,当插入的html包含script标签的时候,需要在script标签之前添加其他的text或者tag,否则插入操作返回成功,但在html中看不到插入的script标签。

 

相关文章:

  • 2021-12-05
  • 2022-03-08
  • 2021-11-23
  • 2022-01-19
猜你喜欢
  • 2021-11-14
  • 2022-12-23
  • 2021-08-10
  • 2022-12-23
  • 2022-12-23
  • 2021-10-03
  • 2022-12-23
相关资源
相似解决方案