squiblo Posted April 28, 2010 Share Posted April 28, 2010 Please could somebody make these two functions into one function function showUser1(str) { xmlhttp1input=GetXmlHttpObject1(); if (xmlhttp1input==null) { alert ("Browser does not support HTTP Request"); return; } var url1="http://localhost/includes/chat/chat_output/sql_output/sql1.php"; url1=url1+"?q="+str; url1=url1+"&sid="+Math.random(); xmlhttp1input.onreadystatechange=stateChanged1; xmlhttp1input.open("GET",url1,true); xmlhttp1input.send(null); } function stateChanged1() { if (xmlhttp1input.readyState==4) { if (document.getElementById("chatoneoutput").innerHTML != xmlhttp1input.responseText){ document.getElementById("chatoneoutput").innerHTML = xmlhttp1input.responseText; } } } 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.