Sign in to follow this  
Followers 0
scsnake

How to check if ajax page "loaded"?

3 posts in this topic

When the page is loading, there's "Loading..." showing up until the page loaded. The "Loading..." is a div object (divLoading).

I want my script to execute next line before the previous action was finished (the page been "loaded"), that is, to wait the "Loading..." to disappear.

Below is the link of that page, the question is that how can I check if the page is loaded?

my idea: use "while" loop to check some parameter, but what parameter?... attribute of some object? or existance of some object???

Link

(search these keywords may help:

divLoadin, NTUHWeb1_UpdateProgress1, Sys.Application.add_init

Thanks in advance :D

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

That page doesn't appear to load for me... it shows unrendered HTML as below.

In any case, what you do depends on how the Loading... text is handled. I've see the text be changed to another string and I've also seen the div be set to DISPLAY:none. You need to figure out what exacly happens on this site - I suggest you use DebugBar.

Then use

$oDiv = _IEGetObjById($oIE, "divLoading")

then use _IEPropertyGet in your While loop to look at either "innertext" our "outerhtml" to see when the change you are waiting for has occurred.

Dale

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >

<HTML>
<HEAD>
<title>DoctorEnterOrder</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="C#" name="CODE_LANGUAGE">
<meta content="Javascript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">;
</HEAD>
<body bottomMargin="0" leftMargin="0" topMargin="0" rightMargin="0">
<form name="Form1" method="post" action="DoctorEnterOrder.aspx?
Edited by DaleHohm

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

thx for the keypoint!

this is the script i want for

Func load_wait()
    sleep(200)
    $loading = _IEGetObjById($oIE2,"NTUHWeb1_UpdateProgress1")
    While $loading.style.display = "block"
        sleep(200)
    WEnd
    sleep(200)
EndFunc

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0