日期:2014-05-16 浏览次数:20825 次
<div id="obtobt"> <select id="obt" name="obt"> <!-- 说话对象 --> <?php foreach($_SESSION["per"] as $value){ echo '<option value="'.$value.'">'.$value.'</option>'; } ?> </select> </div>
foreach($arr as $key => $value){ $tmparr = explode(',',$value); $tmp .= '<img id="head'.$key.'" src="images/'.($tmparr[1]==1?'boy.gif':'girl.gif').'" border="0" width="25" height="26" /> '; $tmp .= '<a onclick=changename("'.$tmparr[0].'")style="cursor:pointer;">'.$tmparr[0].'</a><br>'; }
function changename(name){ url = "talk_chk.php?action=to&name="+name; var select = document.getElementById('obtobt'); xmlhttp.open('GET',url,true); xmlhttp.onreadystatechange = function(){ if(xmlhttp.readyState ==4){ var msg=xmlhttp.responseText; select.innerHTML = msg; } } xmlhttp.send(null); }
url = "talk_chk.php?action=to&name="+name+'&_dc='+new Date().getTime();
------解决方案--------------------