如何循环不使用匿名方法的嵌入式德尔福铬DOM节点?(How to iterate DOM nodes

2019-10-17 07:13发布

德尔福的嵌入式镀铬

由于我有限的技能,我无法弄清楚如何做同样的事情在Delphi 7,因为它不支持匿名方法!

Answer 1:

procedure TheProcThatHandlesItAll(const doc: ICefDomDocument)
var
  q: ICefDomNode;
begin
  // "q" is the ID of the text input element
  q := doc.GetElementById('q');
  if Assigned(q) then
    q.SetElementAttribute('value', 'Hello, world');
end

procedure TMainForm.actDomExecute(Sender: TObject);
begin
  crm.Browser.MainFrame.VisitDomProc(TheProcThatHandlesItAll);
end;


文章来源: How to iterate DOM nodes in Delphi Chromium Embedded without use of anonymous method?