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> Quote Link to comment 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? Quote Link to comment 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. Quote Link to comment 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? Quote Link to comment 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 Quote Link to comment 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? Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
fenway Posted March 14, 2008 Share Posted March 14, 2008 Whic htime? Quote Link to comment 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"; Quote Link to comment 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; Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.