本文整理自网络,侵删。
var
wDoc:IHTMLDocument2;
wc:IHTMLWindow2;
Dispatch:IDispatch;
begin
//遍历emWb:TEmbeddedWB的Frames
if emWb <> nil then
begin
wDoc := ((emWb.Document as IHTMLDocument2));
if Assigned(wDoc) then
begin
for i=0 to wDoc.frams.length -1 do //遍历
begin
Dispatch:= wd.frames.item(0);
Dispatch.QueryInterface(IHTMLWindow2,wc); //获得子frame的IHTMLWindow2对象
wc.execScript('logout()','JavaScript');//执行js
end;
end;
end;
end;
相关阅读 >>
Delphi firedac fdconnection 事务
Delphi tstreamreader tfile assignfile读取文本文件
Delphi 跨平台的,在fmx中读取icon文件的每一帧到bitmap
Delphi xe 网上获取北京时间android app 启动黑屏优化补丁
更多相关阅读请进入《Delphi》频道 >>