聊天室中遇到的问题,在线等待!分不够再给!! 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页面。 在一个页面下点击“添加”按钮 在该页面的下方出现输入框 填写相关信息 保存后在页面上方的数据同时更新 wap中的文本框不能点击到输入文字 php php调用JS提问 表格选中TR,自动勾选CHECKBOX的方法 在一个PHP页面上有两个按钮,有两个PHP函数,如何让第一个按钮调用第一个函数,第二个按钮调用第二个函数? 用php如何获得登陆者的ip地址?50分 找高手 再问MYSQL的问题?谢谢 关于 php.ini 的error_reporting 设置问题,高手请进 出错了,请帮忙调试一下..谢谢 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>
是什么意思呀?
上网找找。