delphi webbrowser与网页相互操作

1.delphi 调用js,触发就是方法:

var

  win: IHTMLWindow2;

begin

 win := IHTMLDocument2(wbmap.Document).parentWindow;
 Win.execScript('addAllPoits(' + QuotedStr(strValue) + ')', 'javascript');

end;

addAllPoits:js的方法

strValue:方法参数;

'javascript':脚本语言;

2.js页面操作触发delphi程序写的方法,主要原理是:修改window.external使JS可调用Delphi方法

参考地址:http://blog.sina.com.cn/s/blog_555305900100d99s.html

原文地址:https://www.cnblogs.com/xgxhellboy/p/2800721.html