日期:2014-05-16  浏览次数:20357 次

高手看看,这段js代码怎么有错误执行不起
想实现的是一个页面设置3秒自动刷新,在打开输入框的层时就不刷新

<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>111</title>
<script language="JavaScript" type="text/javascript">
  function myrefresh(){
  window.location.reload();
  } 
  var obj=document.getElementById("closeshow");
  if(obj.style.display=="none"){
  setTimeout('myrefresh()',30000);
  }
  function showclose() {
  var obj=document.getElementById("closeshow");
  if(obj.style.display=="none"){
  obj.style.display="block";
  }else{
  obj.style.display="none";
  }
  }
</script>
</head>
<body>
<div id="UpdatePanel2">
<table>
  <tr>
  <td width="100" height="30">在线问答:</td>
  <td height="26" >
  <a href="javascript:;" onclick="showclose();">【我要提问】</a></td>
  <td width="150" height="26" align="right" nowrap="nowrap" style="padding-right: 10px;">
  </td>
  <td width="100" height="26" align="right" nowrap="nowrap" style="padding-right: 10px;">
  <A href="javascript:location.reload();"><STRONG>刷 新</STRONG></A></td>
  </tr>
</table>
</div>
  <div id="closeshow" style="display: none;">
  <div id="closewindow">
  <div class="msg_block">
  <table width="500" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" class="bk2">
  <tr>
  <td width="561" background="playimg/title_bg.jpg">
  <strong>&nbsp;我要提问</strong></td>
  <td width="37" align="right" background="playimg/title_bg.jpg">
  <a href="javascript:;" onclick="showclose();">关闭</a>&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" align="center" valign="top" style="padding: 10px;">
<form action="" method="post" name="saypl" id="saypl">
  <label><textarea name="saytext" rows="2" cols="20" id="saytext" style="height:97px;width:416px;"></textarea></label>
  <p><label>&nbsp;<input name="imageField" type="submit" id="imageField" value=" 提 交 " />
  </label></p>
</form>
  </td>
  </tr>
  </table>
  </div>
  </div>
  <div id="gray