Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: How to emulate clicking Edit, Select All, CTRL-C in InterNet Explorer?

From: Martin Honnen <mahotrash@-----.-->
To: NULL
Date: 10/4/2005 2:52:00 PM

MLH wrote:


> OK, maybe I should have asked it this way, using VBA's CreateObject
> function, I utilize the following code snippet to launch a brief
> Microsoft XML HTTP session. With the URL shown, there is
> no problem capturing the webpage source (eBay's time server).
> On the other hand, I cannot say the same for this site:
> http://tycho.usno.navy.mil/cgi-bin/anim
> Can someone explain to me why the navy site causes my Access
> application to lock up tighter than a nun's ass?

> Set msXML = CreateObject("Microsoft.XMLHTTP")
> MyURL =
> "http://cgi1.eXXXbay.com/aw-cgi/eXXXBayISAPI.dll?TimeShow&hc=1&hm=td.s5ddl7437"
> ' The REAL URL does not contain any "XXX" string snippets. Remove them
> ' to get the REAL URL. Cannot post eBay in a URL string on this forum.
> ' Sorry.
> msXML.Open "GET", MyURL, False

You are using a synchronous request (third argument to open is False) 
that will block the script after the send method until the complete 
response has been received.
And that URL takes a long time to complete its response as it uses some 
kind of server push method to send a multipart/x-mixed-replace response 
where a browser is then supposed to render any part of the response, 
then receive the next part and replace the previous part with that.
So a response from that URL starts like this

Date: Tue, 04 Oct 2005 12:32:21 GMT
Server: Apache/2.0.48  HP-UX_Apache-based_Web_Server (Unix) DAV/2 PHP/4.3.4
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: multipart/x-mixed-replace;boundary=---ThisRandomString---


---ThisRandomString---
Content-type: text/html

<CENTER><table border=2 ALIGN=CENTER VALIGN=CENTER CELLPADDING=3>
<TR><TH>US NAVAL OBSERVATORY MASTER CLOCK</TH><TH>Ticks Left</TH><TR><TD 
ALIGN=CENTER >
<H2> Tue Oct  4 12:32:22 2005
  UTC</H2></TD><TD ALIGN=CENTER><H3>31</H3></TD>
</TABLE></CENTER><P>
<A HREF="http://tycho.usno.navy.mil/what.html"> <B>STOP!</B></A>
---ThisRandomString---
Content-type: text/html

<CENTER><table border=2 ALIGN=CENTER VALIGN=CENTER CELLPADDING=3>
<TR><TH>US NAVAL OBSERVATORY MASTER CLOCK</TH><TH>Ticks Left</TH><TR><TD 
ALIGN=CENTER >
<H2> Tue Oct  4 12:32:23 2005
  UTC</H2></TD><TD ALIGN=CENTER><H3>30</H3></TD>
</TABLE></CENTER><P>
<A HREF="http://tycho.usno.navy.mil/what.html"> <B>STOP!</B></A>
---ThisRandomString---

and continues to push such parts every second for a rather long time.

If you really want to use MSXML to get the complete responseText of such 
a response and not have MSXML lock up your script or its application 
then you need to do asynchronous loading (third parameter to open is 
True) and use an onreadystatechange event handler which waits for a 
change of readyState to 4 and then accesses the responseText.

Documentation is here:
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/html/63409298-0516-437d-b5af-68368157eae3.asp>
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/html/ab1b76cf-7dd9-46b5-b782-cc04823df117.asp>


-- 

	Martin Honnen --- MVP XML
	http://JavaScript.FAQTs.com/


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent