347 Star 703 Fork 243

李子/My smart home

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
selectuser.js 1.79 KB
一键复制 编辑 原始数据 按行查看 历史
var xmlHttp
function showUser(str)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
}
var url="getuser.php"
url=url+"?q="+str
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function sendMessage(str)
{
console.log("sendMessage!");
var openid = document.getElementById("openid").value;
var message = document.getElementById("message").value;
console.log("I am Firebug!");
console.log("openid is "+openid);
console.log("message is "+message);
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
}
var url="./LaneWeChat/message.php"
console.log("url is "+url);
url=url+"?openid="+openid
url=url+"&message="+message
xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function modifedUser(str)
{
var myid = document.getElementById("myid").value;
var myname = document.getElementById("myname").value;
console.log("I am Firebug!");
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
}
var url="modifieduser.php"
url=url+"?myid="+myid
url=url+"&myname="+myname
xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function stateChanged()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
document.getElementById("txtHint").innerHTML=xmlHttp.responseText
}
}
function GetXmlHttpObject()
{
var xmlHttp=null;
try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
//Internet Explorer
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/xmeter/My-smart-home.git
git@gitee.com:xmeter/My-smart-home.git
xmeter
My-smart-home
My smart home
master

搜索帮助