我想实现的功能是等用户在某页停留1分钟后,把他的ip地址等信息录入到数据库中!否则不执行录入~用Ajax实现(见下面) setTimeout(表达式,延时时间)是在载入后延迟指定时间后,去执行一次表达式 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 没事写了例子^o^<script language="javascript">function msg(){ alert("载入后到现在已经5秒了,我开始执行了");}setTimeout("msg()",5000);</script> function jishi(){ var xmlhttp=createxmlhttprequest(); xmlhttp.open('get','index.asp?UserEmail='+username.value);//index.asp就是执行操作的sql语句 xmlhttp.send(null); } }<body onload="setTimeout('jishi()',1000*60)">如果你的其他代码没有问题,这样就可以了。 <html><title>无标题文档</title><script language="javascript"> function createxmlhttprequest() { var xmlhttp=false; try { xmlhttp=new ActiveXObject('Msxm12.XMLHTTP'); } catch(e) { try { xmlhttp=new ActiveXObject('Microsoft.XMLHTTP'); } catch(e) { try { xmlhttp=new XmlHttpRequest(); } catch(e) { } } } return xmlhttp; }function jishi(){ var xmlhttp=createxmlhttprequest(); xmlhttp.open('get','index.asp?UserEmail='+username.value);//index.asp就是执行操作的sql语句 xmlhttp.send(null); alert("ok"); } </script></head><body onload="setTimeout('jishi()',60000);"></body></html> javascript中 不能嵌套sql语句 javascript中怎么写sql语句,又不能使用别的语言 xmlhttp.open('get','index.asp?UserEmail='+username.value);//index.asp就是执行操作的可以把sql语句写在这里吗?在去调用一下 如何将字符串匹配到下拉框 firefox 获取 获取到event 但是 获取不到 event里边的属性 用jquery判断窗口是否加载完毕 if判断转为三目运算 是不是类型问题? |zyciis| 在Jquery中 我想要获取当前对像时用$(this)不行,这样会返回jquery,我用$(this)也不行,要怎么办啊,谢谢 关于像素的显示问题 请问关于file控件的问题 弹出新窗口的问题 我是新手,大侠们能否帮帮忙啊? 问个问题,我想实现的效果没有被实现(动态添加DIV) 请问我有两个视频怎么让他们一起播放
function msg(){
alert("载入后到现在已经5秒了,我开始执行了");
}
setTimeout("msg()",5000);
</script>
{
var xmlhttp=createxmlhttprequest();
xmlhttp.open('get','index.asp?UserEmail='+username.value);//index.asp就是执行操作的sql语句
xmlhttp.send(null);
}
}
<body onload="setTimeout('jishi()',1000*60)">
如果你的其他代码没有问题,这样就可以了。
<title>无标题文档</title>
<script language="javascript">
function createxmlhttprequest()
{
var xmlhttp=false;
try
{
xmlhttp=new ActiveXObject('Msxm12.XMLHTTP');
}
catch(e)
{
try
{
xmlhttp=new ActiveXObject('Microsoft.XMLHTTP');
}
catch(e)
{
try
{
xmlhttp=new XmlHttpRequest();
}
catch(e)
{
}
}
}
return xmlhttp;
}
function jishi()
{
var xmlhttp=createxmlhttprequest();
xmlhttp.open('get','index.asp?UserEmail='+username.value);//index.asp就是执行操作的sql语句
xmlhttp.send(null);
alert("ok");
}
</script>
</head><body onload="setTimeout('jishi()',60000);"></body>
</html>
可以把sql语句写在这里吗?在去调用一下