Jump to content

Object required error in IE.


GB_001

Recommended Posts

Hello,

For some reason I get an Object required message when I try this in IE, but it works fine in any other browser.

 

<ht ml>
<head>
<sc  ript lan  guage="JavaScript" ty  pe="text/JavaScript">
function ajaxFunc(){
var ajaxRequest;

try{
ajaxRequest = new XMLHttpRequest();
} catch (e){

try{
ajaxRequest = new ActiveXObject('Msxml2.XMLHTTP');
} catch (e) {
try{
ajaxRequest = new ActiveXObject('Microsoft.XMLHTTP');
} catch (e){

alert('Your browser broke!');
return false;
}
}
}

ajaxRequest.onreadystatechange = function(){

if(ajaxRequest.readyState == 4){
var ajaxDisplay = parent.document.getElementById('divvy');
ajaxDisplay.innerHTML = ajaxRequest.responseText;
}

}
var url = 'OpenC.php';
ajaxRequest.open('GET', url, true);
ajaxRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
ajaxRequest.send(null);
}


var ie = parent.document.all;
var nn6 = parent.document.getElementById &&! parent.document.all;

var isdrag = false;
var x, y;
var dobj;

function movemouse( e ) {
if( isdrag ) {
dobj.style.left = nn6 ? tx + e.clientX - x : tx + event.clientX - x;
dobj.style.top = nn6 ? ty + e.clientY - y : ty + event.clientY - y;
return false;
}
}

function selectmouse( e ) {
var fobj = nn6 ? e.target : event.srcElement;
var topelement = nn6 ? "HTML" : "BODY";

while (fobj.tagName != topelement && fobj.className != "dragme") {
fobj = nn6 ? fobj.parentNode : fobj.parentElement;
}

if (fobj.className=="dragme") {
isdrag = true;
dobj = parent.document.getElementById("styled_popup");
tx = parseInt(dobj.style.left+0);
ty = parseInt(dobj.style.top+0);
x = nn6 ? e.clientX : event.clientX;
y = nn6 ? e.clientY : event.clientY;
parent.document.onmousemove=movemouse;
return false;
}
}

function styledPopupClose() {
parent.document.getElementById("styled_popup").style.display = "none";
}
parent.document.onmousedown=selectmouse;
parent.document.onmouseup=new Function("isdrag=false");
</s  cript>
</head>
<body onLoad="ajaxFunc();">
</body>
</h tml>

Link to comment
Share on other sites

I think somewhere around here:

 

function movemouse( e ) {
if( isdrag ) {
dobj.style.left = nn6 ? tx + e.clientX - x : tx + event.clientX - x;
dobj.style.top = nn6 ? ty + e.clientY - y : ty + event.clientY - y;
return false;
}
}

function selectmouse( e ) {
var fobj = nn6 ? e.target : event.srcElement;
var topelement = nn6 ? "HTML" : "BODY";

 

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.