Once function AJAX() is called it cannot be called again. <script type="text/javascript"> <!-- var xmlHttp; try { // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); } catch (e) { // Internet Explorer try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { alert("Your browser does not support AJAX!"); } } } function AJAX(Ref,Spec,Elem) { xmlHttp.onreadystatechange=function() { if(xmlHttp.readyState==4) { var oldElem = document.getElementById(Elem); oldElem.innerHTML = xmlHttp.responseText; } } ReqStr = "AJAX.php?Ref=" + Ref + "&Spec=" + Spec + "&Elem=" + Elem; xmlHttp.open("Get",ReqStr,true); xmlHttp.send(null); } //--> </script> Code (markup): http://trollnest.com/bragflags/default.php To see behavior, roll over category menu item, works once then never again. It is stuck in request loop I believe.
Seems like your javascript does nothing. It creates XMLHttpRequest object, calls xmlHttp.open and that's all. I see not loop at all here. Didn't you forget to handle onreadystatechange event? Usually one assigns handler function to this event to process received data. function stateUpdateChanged() { alert('Data received: ' + xmlHttp.responseText); } xmlHttp.onreadystatechange=stateUpdateChanged;