如何在MSHTML中设置整个HTML?
如何在MSHTML中设置整个HTML?
我正在尝试使用此作业:
(Document as IHTMLDocument3).documentElement.innerHTML := 'abc';
但出现错误:
“目标元素对此无效 操作”
我也尝试过使用,
(Document as IHTMLDocument2).write
但这种形式只将 HTML 添加到正文部分,我需要替换所有 HTML 源。
有人知道我该怎么做吗?
提前致谢。
How to set entire HTML in MSHTML?
I am trying using this assignment:
(Document as IHTMLDocument3).documentElement.innerHTML := 'abc';
but I got the error:
"Target element invalid for this
operation"
I've also tried using
(Document as IHTMLDocument2).write
but this form only adds HTML into the body section, and I need to replace all the HTML source.
Does somebody have any idea of how I do this?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是我的一些旧代码,看看它是否对你有帮助:
Here's some of my old code, see if it helps you:
作为替代方案,您还可以使用 TEmbededWB,它是 Web 浏览器的扩展包装器,并且具有一些功能提供此功能的易于使用的方法。
As an alternative you can also use TEmbededWB which is an extended wrapper around a web browser and has some easy to use methods that provide this functionality.