当前位置: 代码迷 >> PB >> 怎么判断navigate2网页加载完成
  详细解决方案

怎么判断navigate2网页加载完成

热度:15   发布时间:2016-04-29 07:45:50.0
如何判断navigate2网页加载完成?
ole_2.object.navigate2('www.baidu.com')
有个疑问navigate2没有返回加载成功的标记
那如何去判断Ole_2 (Microsoft Web Browser) 是否完成加载网页?
通过网页标识? 还是有其他的解决方法?
希望得到高手的指点。
------解决方案--------------------
在documentcomplete里面用
string ls_title
ls_title = this.object.document.title
if match(ls_title,'无法') or match(ls_title,'cannot') then
this.object.navigate('about:blank')
messageBox('提示','连接不到服务器或网络错误!')
return
end if
------解决方案--------------------
自定义一个计时器,窗口上也可以直接用窗口的timer事件。

navigate之后,timer(.1)
窗口上另放一个文本控件(st_1),用于显示页面加载情况。

在timer事件中写代码

boolean lb_state

lb_state = ole_1.object.busy
if lb_state then
st_1.text = '页面加载中......'
else
st_1.text = '页面加载完成!'
timer(0)
messagebox('提示','页面加载完成!')
end if
  相关解决方案