这两个函数分别什么用 一行行解释下,麻烦了 没用过这控件
function GetHTML(Document:IHTMLDocument2):String;
var
i:integer;
IDisp:IDispatch;
pElement:IHTMLElement;
begin
for I := 0 to Document.all.length - 1 do
begin
IDisp:=Document.all.item(i,i);
IDisp.QueryInterface(IID_IHTMLElement,pElement);
if CompareText(pElement.id, 'sourceEditor') = 0 then
begin
Result := pElement.outerText;
exit;
end;
end;
end;function SetHTML(Document:IHTMLDocument2; Str: string): string;
var
i:integer;
IDisp:IDispatch;
pElement:IHTMLElement;
begin
for I := 0 to Document.all.length - 1 do
begin
IDisp := Document.all.item(i,i);
IDisp.QueryInterface(IID_IHTMLElement,pElement);
if CompareText(pElement.id, 'sourceEditor') = 0 then
begin
pElement.insertAdjacentText('beforeEnd', Str);
Exit;
end;
end;
end;
function GetHTML(Document:IHTMLDocument2):String;
var
i:integer;
IDisp:IDispatch;
pElement:IHTMLElement;
begin
for I := 0 to Document.all.length - 1 do
begin
IDisp:=Document.all.item(i,i);
IDisp.QueryInterface(IID_IHTMLElement,pElement);
if CompareText(pElement.id, 'sourceEditor') = 0 then
begin
Result := pElement.outerText;
exit;
end;
end;
end;function SetHTML(Document:IHTMLDocument2; Str: string): string;
var
i:integer;
IDisp:IDispatch;
pElement:IHTMLElement;
begin
for I := 0 to Document.all.length - 1 do
begin
IDisp := Document.all.item(i,i);
IDisp.QueryInterface(IID_IHTMLElement,pElement);
if CompareText(pElement.id, 'sourceEditor') = 0 then
begin
pElement.insertAdjacentText('beforeEnd', Str);
Exit;
end;
end;
end;
解决方案 »
- 有一首MP3的文件,已保存到数据库中,如何将它播放出来,而不用 savetofile 的方式?
- 求关于如何根据ClientDataSet.Delta提交数据的函数
- 如何能使Table的Filter输入更多的东西??在线等待
- 窗体建好后,为什么不能最小化?
- <由于是新手,所以会有很多问题要请教的>一个关于数据库As的问题!
- delphi 怎么调用access表,-----在线等
- 初学者提问(不要笑我哟)!如何ado连接数据库,另外程序发布时,需要bde吗? 谢谢!
- SuspendThread返回-1,怎么解决?
- 数据库的连接(BDE 怎样连接到 ACCESS)?
- 如何对使用DataBase的数据库,使用Access驱动,读取Access97数据库的程序打包?
- 请问怎样得到ADOQuery批量更新的记录
- 急!求高手指导!如何让exe文件变成隐藏文件
第二个是在'sourceEditor'中添加html代码