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; } } } Link to comment https://forums.phpfreaks.com/topic/200048-making-2-functions-into-1/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.