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

posted on 2012-12-04 09:27  呼嘎嘎  阅读(2977)  评论(1编辑  收藏  举报

导航