如何加载更新的内容以使用webbrowser控件进行一些处理 [英] How to load the the updated content to do some processing using webbrowser control

查看:86
本文介绍了如何加载更新的内容以使用webbrowser控件进行一些处理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I'm using a WebBrowser control in my app to load a page that updates its content dynamically via Ajax. I need to access the updated content to do some processing, but since the calls are made with Ajax the page doesn't get refreshed and thus the DocumentComplete event doesn't fire. 
Is there a way to get notified when a call is made using the XMLHttpRequest object? Some event fires maybe?
Any help will be appreciated, 





我尝试过:



我不会在这件事上尝试任何事情



What I have tried:

I don't try any thing in this matter

推荐答案

XMLHttpRequest 有一个属性onReadyStateChange。



您可以为此分配一个函数,例如:



XMLHttpRequest has a property onReadyStateChange.

You can assign a function to this such as:

var xmlHttpReq;  // You need to fill-in details for creation of this
                 // request object and triggering the request etc.

function respAjax() {
  if (xmlHttpReq.readState == 4) {
    // Request has finished and response is ready.
    // Do whatever you want here..
  }
}

xmlHttpReq.onReadStateChange = respAjax;





Sams_Teach_Yourself_Ajax .. 提供了更多信息,如果您正在使用Ajax,这是一本非常棒的书。



Chapter 11 of Sams_Teach_Yourself_Ajax.. provides much more info, and if you're doing Ajax this is a superb book to read.


这篇关于如何加载更新的内容以使用webbrowser控件进行一些处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆