469,903 Members | 1,676 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,903 developers. It's quick & easy.

can not create activexobject("microsoft.xmlhttp")

I have some client with IE 6 sp1 that when I run the following line I have an exception :
var poster = new activexobject("Microsoft.xmlHttp"|);
The web page that call this js line is ssl.
Do you have an idea why it works on some computers and on others not?
Jan 1 '07 #1
3 7393
4,258 Expert 4TB
Could be you are using a lower JavaScript version (< 5) and have to use Msxml2.XMLHTTP. The following snippet of code handles this also for older versions. Try it and see if the error persists.
[html]//Create a boolean to check for a valid IE instance.
var xmlhttp = false;

//Check if we are using IE.
try {
//If the Javascript version is greater than 5.
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
//If not, then use the older active x object.
try {
//If we are using MS.
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
//Else we must be using a non-IE browser.
xmlhttp = false;

//If using a non-IE browser, create a js instance of the object.
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
xmlhttp = new XMLHttpRequest();
Ronald :cool:
Jan 1 '07 #2
I have a page that call the following line in js :
var x = new activexobject("Microsoft.xmlhttp");

This line works on some computers and do not work on anothers.
All the computers have IE6 sp1.

The page that call the js run under ssl.

Do you have an idea what is the problem?

Jan 2 '07 #3
4,258 Expert 4TB
You are double posting in this thread!!

Before starting this double thread, why don't you first look at the reply posts in your original thread at http://www.thescripts.com/forum/thread582818.html

Ronald :cool:
Jan 2 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by PISINC | last post: by
3 posts views Thread by Bad_Kid | last post: by
4 posts views Thread by =?Utf-8?B?QWxoYW1icmEgRWlkb3MgS2lxdWVuZXQ=?= | last post: by
7 posts views Thread by czechboy | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.