【发布时间】:2013-04-26 17:56:45
【问题描述】:
有人有如何使用 CDHtmlDialog 注入 Javascript 变量的示例吗?使用 Google 或 MSDN 似乎没有任何现成的解决方案。假设“window.external”在 HTML 中不可用。
【问题讨论】:
标签: javascript c++ html mfc
有人有如何使用 CDHtmlDialog 注入 Javascript 变量的示例吗?使用 Google 或 MSDN 似乎没有任何现成的解决方案。假设“window.external”在 HTML 中不可用。
【问题讨论】:
标签: javascript c++ html mfc
获得 IHTMLDocument2 的方式是 CDHtmlDialog::GetDHtmlDocument。您需要等待 DocumentComplete 才能访问该文档。 Doing it early may not work.
你调用脚本的方式是through the IHTMLWindow2 interface。您可以通过 IHTMLDocument2::parentWindow 属性获取窗口。只需在您执行的 jscript 中声明一个变量即可。
【讨论】: