|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Microsoft.XMLHTTP
Hi
I hope you guys know this object, I am using it with JavaScript, does anybody know which browsers support "Microsoft.XMLHTTP" and what versions of them, please? thanks Jim |
|
#2
|
|||
|
|||
|
RE: Microsoft.XMLHTTP
IE5+/Win
but in mozilla (and all gecko-based browsers), and safari you can use XMLHTTPRequest class.. |
|
#3
|
|||
|
|||
|
RE: Microsoft.XMLHTTP
is there a method that is supported by all (Mozila, safari, IE, Netscape etc.)?
|
|
#4
|
|||
|
|||
|
RE: Microsoft.XMLHTTP
no, but you only need to use different constructors, the usage of the object is the same in any browser..
so, for example, start with.. Code:
if (window.XMLHttpRequest) {
req = new XMLHttpRequest();
} else {
req = new ActiveXObject('Microsoft.XMLHTTP'));
}
after that, you can use the req object, and it will work in all the browsers (except opera).. |
|
#5
|
|||
|
|||
|
RE: RE: Microsoft.XMLHTTP
I really thank you very much!
what do suggest I do with Opera? |
|
#6
|
|||
|
|||
|
RE: Microsoft.XMLHTTP
opera doesn't have support for this..
maybe you can hack something with loading pages into (hidden) IFRAMEs, and then reading the content, but that seems like a great trouble for such a minor browser.. |
|
#7
|
|||
|
|||
|
RE: RE: Microsoft.XMLHTTP
i'm still stuck with this...
here is the code i am using: Code:
function get_page(){
if (window.XMLHttpRequest) {
var http = new XMLHttpRequest();
} else {
var http = new ActiveXObject('Microsoft.XMLHTTP'));
}
try
{
http.Open("GET","http://www.yahoo.com",false);
http.send();
if(http.readyState==4)
{
document.write(http.responseText);
}
}
catch(e)
{
if(e instanceof Error) {return 0}
}
}
if I use an address that does not exits (Example: "http://www.yahoo.com/bababa/") my browser gets stuck. any idea how to set a timeout for fetching a page, or a way to return if the page can not be fetched? thanks |
|
#8
|
|||
|
|||
|
RE: Microsoft.XMLHTTP
please?
|
|
#9
|
|||
|
|||
|
RE: Microsoft.XMLHTTP
Maybe there is a request header you can add to specify your timeout??
|
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Client Side Things > Microsoft.XMLHTTP |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|