Jump to content

I wish I could blow up IE.. need some help


vincea

Recommended Posts

Ok well this is a basic script.. but won't work in IE. Works in Opera, Navigator, Firefox but not in IE.. of course.

Basically all it does is load a .php file when the link is clicked making Ajax show the .php file in a <div>

BUT IE refuses to co-operate with the text link command, I have tried different variants and still nothing. It is IE 6.

the code....

The menu link in the body of the page which submits the php file and the div ID
[code]<li><a href="#" onClick="getData('member.php?mem=mike', 'contentContainer')">&raquo; Mike</a></li>[/code]


and here is the basic XMLHttpRequest object in the head..
[code]
var XMLHttpRequestObject = false;

if (window.XMLHttpRequest) {
XMLHttpRequestObject = new XMLHttpRequest();
} else if (window.ActiveXObject) {
HttpRequestObject = new ActiveXObject("Microsoft.XMLHTTP");
}

function getData(dataSource, divID) {

if (XMLHttpRequestObject) {
var obj = document.getElementById(divID);
XMLHttpRequestObject.open("GET", dataSource);

XMLHttpRequestObject.onreadystatechange = function() {
if (XMLHttpRequestObject.readyState == 1) {
obj.innerHTML = "<div id='load'>Loading.. <img src='spinner.gif'></div>";
initLightbox();
}
if (XMLHttpRequestObject.readyState == 4 && XMLHttpRequestObject.status == 200) {
obj.innerHTML = XMLHttpRequestObject.responseText;
}
}
XMLHttpRequestObject.send(null);
}
}
[/code]

Any help would be great...
Vince
Link to comment
Share on other sites

Umm... you're naming the object 2 different things.
[code]if (window.XMLHttpRequest) {
XMLHttpRequestObject = new XMLHttpRequest();
} else if (window.ActiveXObject) {
XMLHttpRequestObject = new ActiveXObject("Microsoft.XMLHTTP");
}[/code]

Try that.  That would be why IE isn't working, because you're never doing anything with IE's object.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.