readystate

How to detect if DOMContentLoaded was fired

让人想犯罪 __ 提交于 2019-11-27 11:46:33
I'm trying to help developing a library and for it I'm trying to work with page loading. In the process I want to make the library completely compatible with the use of defer and async. What I want is simple: How can I know that DOMContentLoaded was fired by the time the file is executed? Why is this so difficult? In IE, document.readyState show interactive before DOMContentLoaded. I won't use browser detection in any way, it's against the policy of me and the rest of the participants. What's the correct alternative? Edit: Seems like I wasn't clear enough. I'm not interested to know if the

Failproof Wait for IE to load

巧了我就是萌 提交于 2019-11-27 08:58:29
Is there a foolproof way for the script to wait till the Internet explorer is completely loaded? Both oIE.Busy and / or oIE.ReadyState are not working the way they should: Set oIE = CreateObject("InternetExplorer.application") oIE.Visible = True oIE.navigate ("http://technopedia.com") Do While oIE.Busy Or oIE.ReadyState <> 4: WScript.Sleep 100: Loop ' <<<<< OR >>>>>> Do While oIE.ReadyState <> 4: WScript.Sleep 100: Loop Any other suggestions? Try this one, it helped me to solve similar problem with IE once: Set oIE = CreateObject("InternetExplorer.application") oIE.Visible = True oIE.navigate

Get ReadyState from WebBrowser control without DoEvents

拜拜、爱过 提交于 2019-11-27 05:22:26
This has been awnsered many times here and at other sites and its working, but I would like ideas to other ways to: get the ReadyState = Complete after using a navigate or post, without using DoEvents because of all of its cons. I would also note that using the DocumentComplete event woud not help here as I wont be navigating on only one page, but one after another like this. wb.navigate("www.microsoft.com") //dont use DoEvents loop here wb.Document.Body.SetAttribute(textbox1, "login") //dont use DoEvents loop here if (wb.documenttext.contais("text")) //do something The way it is today its

Ajax won't get past readyState 1, why?

六眼飞鱼酱① 提交于 2019-11-27 02:53:02
问题 I'm trying to get this function to work, which does a request for parameter url then sends the responseText to callback which is a function. It seems that it only gets to readyState 1 (thanks to the Firebug commands). Here it is: function Request(url, callback){ if (window.XMLHttpRequest) { // Mozilla, Safari, ... httpRequest = new XMLHttpRequest(); } else if (window.ActiveXObject) { // IE httpRequest = new ActiveXObject("Microsoft.XMLHTTP"); } else{ return false; } httpRequest

How to detect if DOMContentLoaded was fired

时光总嘲笑我的痴心妄想 提交于 2019-11-26 22:21:07
问题 I'm trying to help developing a library and for it I'm trying to work with page loading. In the process I want to make the library completely compatible with the use of defer and async. What I want is simple: How can I know that DOMContentLoaded was fired by the time the file is executed? Why is this so difficult? In IE, document.readyState show interactive before DOMContentLoaded. I won't use browser detection in any way, it's against the policy of me and the rest of the participants. What's

Failproof Wait for IE to load

时间秒杀一切 提交于 2019-11-26 14:24:34
问题 Is there a foolproof way for the script to wait till the Internet explorer is completely loaded? Both oIE.Busy and / or oIE.ReadyState are not working the way they should: Set oIE = CreateObject("InternetExplorer.application") oIE.Visible = True oIE.navigate ("http://technopedia.com") Do While oIE.Busy Or oIE.ReadyState <> 4: WScript.Sleep 100: Loop ' <<<<< OR >>>>>> Do While oIE.ReadyState <> 4: WScript.Sleep 100: Loop Any other suggestions? 回答1: Try this one, it helped me to solve similar

What do the different readystates in XMLHttpRequest mean, and how can I use them?

不羁的心 提交于 2019-11-26 04:34:28
问题 XMLHttpRequest has 5 readyState s, and I only use 1 of them (the last one, 4 ). What are the others for, and what practical applications can I use them in? 回答1: The full list of readyState values is: State Description 0 The request is not initialized 1 The request has been set up 2 The request has been sent 3 The request is in process 4 The request is complete (from https://www.w3schools.com/js/js_ajax_http_response.asp) In practice you almost never use any of them except for 4. Some