在页面中,有用javascript脚本生成的array :
<SCRIPT language=JavaScript>
var Game=new Array();
Game[0]=new Array('1','2','3');我用WebBrowser1.OleObject.document.Game.length能得到array长度,但如果写WebBrowser1.OleObject.document.Game[0][1] 就出错,但写WebBrowser1.OleObject.document.Game可以返回整个数组,我该如何指定访问数组中的某个元素呢 ??
<SCRIPT language=JavaScript>
var Game=new Array();
Game[0]=new Array('1','2','3');我用WebBrowser1.OleObject.document.Game.length能得到array长度,但如果写WebBrowser1.OleObject.document.Game[0][1] 就出错,但写WebBrowser1.OleObject.document.Game可以返回整个数组,我该如何指定访问数组中的某个元素呢 ??
解决方案 »
- File accescc denied
- 这个Struct怎么转为Delphi的class
- 一个treeview的问题,如何将一个treeview连同它各个节点的数据复制到另一个treeview!!急急!!!各位大虾帮帮忙
- delphi7写的类型为wad的webservice,如何在IIS中发布?~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 谁有完成端口通讯程序的Delphi源码?
- 100分求:如何用API函数取一个目录的大小!
- 请教SQL!
- delphi简单问题
- 多元一次方程组的解法(算法)???
- Delphi Math单元函数mean怎么用啊?
- 请问ADODataSet属性’Cursortype’中的几个枚举类型是什么意思?
- 主从表查询
var
doc:IHTMLDocument2;
begin
doc := WebBrowser1.Document as IHTMLDocument2;
memo1.text:=doc.body.innerHTML ;
NavigateFrameset(doc) ;
end;procedure TForm1.NavigateFrameset(document: IHTMLDocument2);
var
index: Integer;
ole_index: OleVariant;
frame_dispatch: IDispatch;
framed: IHTMLWindow2;
begin
if document = nil then
exit;
try
Application.MessageBox(
PChar('Content:' + String(document.body.innerHTML)),
PChar('URL: ' + String(document.URL)),MB_OK or
MB_ICONINFORMATION);
for index := 1 to document.Frames.Length do
try
ole_index := index-1;
frame_dispatch := document.Frames.Item(ole_index);
if frame_dispatch <> nil then
begin
framed := frame_dispatch as IHTMLWindow2;
NavigateFrameset(framed.document);
end;
except
on E: Exception do
begin
end
end;
except
on E: Exception do
begin
Application.MessageBox(PChar(E.Message),
PChar('Exception'));
end;
end;
end;
import the "Microsoft HTML Object Library" (MSHTML.TLB) and include MSHTML_TLB in the unit's uses clause
这个问题困扰我很长时间,今天彻底解决了,希望和大家共享,绝对通过了,别怕麻烦,你拷贝过去,试验一下
可以显示所有frame