聊天室中遇到的问题,在线等待!分不够再给!! 1.通过此用户是否在线来决定是否允许用户进入。2.iframesetInterval("parent.frameName.location.reload()",1000) 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 (2)聊天室大都是是用了frame框架。一般都有一个自动刷新的帧,这个frame可以隐藏。这个振负责定时去连接服务器,取得最新的数据。取得数据后,可以采用javascript来写另外的振。至于你说的刷新那个下拉框,就可以用javascript来实现。 给一个动态改变列表的例子(有点长,当时是为了给别的做例子的)--------------------------------------------------------<html><head><title>Untitled Document</title><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><script language="JavaScript"><!--function onClkRdo(str){ //定义下拉列表的内容 //其中第一项为value值,第二项为text值 var arr_a = new Array("A11","a1","A22","a2","A33","a3"); var arr_b = new Array("B11","b1","B22","b2","B33","b3","B44","b4"); if(str=="aa"){ //选中了A document.f.sel.length=arr_a.length/2; //首先根据a要限制的内容的数组限定显示对象的个数 //循环依次添入要显示的对象 for(var i=0;i<arr_a.length/2;i++){ document.f.sel.options[i].value=arr_a[2*i]; document.f.sel.options[i].text=arr_a[2*i+1]; } //缺省选择第一个选项 document.f.sel.selectedIndex=0; //TEST: alert("A"); return; } if(str=="bb"){ //选中了B document.f.sel.length=arr_b.length/2; //循环依次添入要显示的对象 for(var i=0;i<arr_b.length/2;i++){ document.f.sel.options[i].value=arr_b[2*i]; document.f.sel.options[i].text=arr_b[2*i+1]; } //缺省选择第一个选项 document.f.sel.selectedIndex=0; //TEST: alert("B"); return; }}function onSel(){ var str=''; str+="列表框的名称:"+document.f.sel.name+'\n'; str+="列表框的对象的总个数:"+document.f.sel.length+'\n'; str+="select对象中当前被选option的下标:"+document.f.sel.selectedIndex+'\n'; str+="select对象中当前被选的项的text值:"+document.f.sel.options[document.f.sel.selectedIndex].text+'\n'; str+="select对象中当前被选的项的value值:"+document.f.sel.options[document.f.sel.selectedIndex].value+'\n'; alert(str);}//--></script></head><body bgcolor="#FFFFFF" text="#000000"><form name="f" method="post" action=""> <p> </p> <p> </p> <input type="radio" name="rdo" value="aa" onClick="javascript:onClkRdo(this.value)">A <br> <input type="radio" name="rdo" value="bb" onClick="javascript:onClkRdo(this.value)">B <br> <p> </p> <p> <select name="sel" onChange="javascript:onSel()"> </select> </p></form></body></html> 谢谢,我试试看!setInterval("parent.frameName.location.reload()",1000)是什么意思呀? 你知道什么是setTimeout吗?上网找找。 每1秒刷新一次名为frameName的frame页面。 PHP报表开发工具 [散分]有PHP的兄弟转到JAVA或C等其他语言上的吗... PHPBB的CSS 如何能做更改 我想知道ini_set()可以设置哪些配置到哪了解? 有人用过全文索引的MATCH ... AGAINST()吗? 请问哪里有php+mysql网上考试的源代码下载呀? 如何将字符串变成:%74%74%70%3a%2f%2f%77%77%77%的形式 帮忙看看程序!运行后不能得出正确结论,请指点!谢谢! 怎么用PHP删除FTP服务器上的空目录 如何分割这个字符串?在线等。。。。 出错了,请帮忙调试一下..谢谢 sql语句无法更新数据,请教
一般都有一个自动刷新的帧,这个frame可以隐藏。
这个振负责定时去连接服务器,取得最新的数据。取得数据后,可以采用javascript来写另外的振。至于你说的刷新那个下拉框,就可以用javascript来实现。
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="JavaScript">
<!--
function onClkRdo(str)
{
//定义下拉列表的内容
//其中第一项为value值,第二项为text值
var arr_a = new Array("A11","a1","A22","a2","A33","a3");
var arr_b = new Array("B11","b1","B22","b2","B33","b3","B44","b4");
if(str=="aa"){ //选中了A
document.f.sel.length=arr_a.length/2; //首先根据a要限制的内容的数组限定显示对象的个数
//循环依次添入要显示的对象
for(var i=0;i<arr_a.length/2;i++){
document.f.sel.options[i].value=arr_a[2*i];
document.f.sel.options[i].text=arr_a[2*i+1];
}
//缺省选择第一个选项
document.f.sel.selectedIndex=0;
//TEST: alert("A");
return;
}
if(str=="bb"){ //选中了B
document.f.sel.length=arr_b.length/2;
//循环依次添入要显示的对象
for(var i=0;i<arr_b.length/2;i++){
document.f.sel.options[i].value=arr_b[2*i];
document.f.sel.options[i].text=arr_b[2*i+1];
}
//缺省选择第一个选项
document.f.sel.selectedIndex=0;
//TEST: alert("B");
return;
}
}function onSel()
{
var str='';
str+="列表框的名称:"+document.f.sel.name+'\n';
str+="列表框的对象的总个数:"+document.f.sel.length+'\n';
str+="select对象中当前被选option的下标:"+document.f.sel.selectedIndex+'\n';
str+="select对象中当前被选的项的text值:"+document.f.sel.options[document.f.sel.selectedIndex].text+'\n';
str+="select对象中当前被选的项的value值:"+document.f.sel.options[document.f.sel.selectedIndex].value+'\n';
alert(str);
}
//-->
</script>
</head><body bgcolor="#FFFFFF" text="#000000">
<form name="f" method="post" action="">
<p> </p>
<p> </p>
<input type="radio" name="rdo" value="aa" onClick="javascript:onClkRdo(this.value)">A
<br>
<input type="radio" name="rdo" value="bb" onClick="javascript:onClkRdo(this.value)">B
<br>
<p> </p>
<p>
<select name="sel" onChange="javascript:onSel()"> </select>
</p>
</form>
</body>
</html>
是什么意思呀?
上网找找。