GB_001 Posted March 14, 2008 Share Posted March 14, 2008 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 https://forums.phpfreaks.com/topic/96093-object-required-error-in-ie/ Share on other sites More sharing options...
haku Posted March 14, 2008 Share Posted March 14, 2008 Which part of the code is giving you the error? Link to comment https://forums.phpfreaks.com/topic/96093-object-required-error-in-ie/#findComment-491929 Share on other sites More sharing options...
GB_001 Posted March 14, 2008 Author Share Posted March 14, 2008 The part after the AJAX function, I think it might be fobj. Link to comment https://forums.phpfreaks.com/topic/96093-object-required-error-in-ie/#findComment-491957 Share on other sites More sharing options...
haku Posted March 14, 2008 Share Posted March 14, 2008 I guess I worded that wrongly. Can you post the error? Link to comment https://forums.phpfreaks.com/topic/96093-object-required-error-in-ie/#findComment-491989 Share on other sites More sharing options...
GB_001 Posted March 14, 2008 Author Share Posted March 14, 2008 Oh sorry, here: Line:55 Char:3 Error: Object required Link to comment https://forums.phpfreaks.com/topic/96093-object-required-error-in-ie/#findComment-492409 Share on other sites More sharing options...
fenway Posted March 14, 2008 Share Posted March 14, 2008 Don't make us count... which line is that? Link to comment https://forums.phpfreaks.com/topic/96093-object-required-error-in-ie/#findComment-492447 Share on other sites More sharing options...
GB_001 Posted March 14, 2008 Author Share Posted March 14, 2008 I think it's the line where Fobj was defined. Link to comment https://forums.phpfreaks.com/topic/96093-object-required-error-in-ie/#findComment-492502 Share on other sites More sharing options...
fenway Posted March 14, 2008 Share Posted March 14, 2008 Whic htime? Link to comment https://forums.phpfreaks.com/topic/96093-object-required-error-in-ie/#findComment-492528 Share on other sites More sharing options...
GB_001 Posted March 14, 2008 Author Share Posted March 14, 2008 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 https://forums.phpfreaks.com/topic/96093-object-required-error-in-ie/#findComment-492530 Share on other sites More sharing options...
GB_001 Posted March 15, 2008 Author Share Posted March 15, 2008 Found the problem, I just need to know how to fix it now. var fobj = nn6 ? e.target : event.srcElement; Link to comment https://forums.phpfreaks.com/topic/96093-object-required-error-in-ie/#findComment-493053 Share on other sites More sharing options...
fenway Posted March 17, 2008 Share Posted March 17, 2008 I'm guessing either e or event doesn't exist. Link to comment https://forums.phpfreaks.com/topic/96093-object-required-error-in-ie/#findComment-493711 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.