html 刷新问题!!求解,急,急,急

小衲还需努力 2011-12-05 10:35:26
页面代码如下求高手指点:
要求:点击gobcak()页面返回上一层并且达到刷新的效果
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />

<link rel="StyleSheet" href="../image/main.css" type="text/css" />

<title>Home Gateway Remote Control System - v1.0</title>

<script type="text/javascript">

function showTime()

{

var dt=new Date();

document.getElementById("time").innerHTML=dt.getFullYear()+"-"+(dt.getMonth()<9?"0"+(dt.getMonth()+1):dt.getMonth()+1)+"-"+(dt.getDate()<10?"0"+dt.getDate():dt.getDate())+" "+(dt.getHours()<10?"0"+dt.getHours():dt.getHours())+":"+(dt.getMinutes()<10?"0"+dt.getMinutes():dt.getMinutes())+":"+(dt.getSeconds()<10?"0"+dt.getSeconds():dt.getSeconds());

}

function goHome()

{

if(window.main_frame.document.title=="index")

return;

window.main_frame.location="/hit/cgi-bin/hitb?todo=main";

}

function goBack()

{

if(window.main_frame.document.title=="index")

{

if(confirm("Recognizing that withdrawal?"))

window.main_frame.location="hitb?todo=quit";

return;

}

if(window.main_frame.document.title=="login")

{

return;

}

window.main_frame.history.back();

}

function alwaysOnTop()

{

if (top.location != location)

top.location.href = location.href;

}

</script>

</head>

<body>

<script type="text/javascript"> alwaysOnTop(); </script>

<div style="width:660px;margin:0 auto;">

<div style="height:405px;margin-top:10px;background-image:url(../image/bg.gif);">

<table cellpadding="0" cellspacing="0" width="649px" height="384px" style="margin-left:6px;padding:0 4px 0 5px;border:0;">

<tr><td height="0px"> </td></tr>

<tr><td style="height:45px;font-size:14px;font-weight:bold;">

<div id="logo" style="float:left;width:160px;line-height:45px;"><img src="../image/logo.png" /></div>

<div id="time" style="float:right;width:200px;text-align:right;line-height:45px;"></div>

<script type="text/javascript"> showTime(); setInterval('showTime()',1000); </script>

</td></tr>

<tr><td style="height:282px;"><iframe id="main_frame" name="main_frame" src="/hit/cgi-bin/hitb?todo=main" frameborder="0" height="282px" width="639px">请使用最新的 IE 或者 FireFox 浏览器</iframe></td></tr>

<tr><td style="height:57px;">

<div style="float:left; width:103px;"><a href="javascript:goHome();"><img src="../image/home1.gif" onmouseover="this.src='../image/home2.gif';" onmouseout="this.src='../image/home1.gif';" /></a></div>

<div style="float:right; width:103px;"><a href="javascript:goBack();"><img src="../image/back1.gif" onmouseover="this.src='../image/back2.gif';" onmouseout="this.src='../image/back1.gif';" /></a></div>

</td></tr>

</table>

</div>

<div id="footer" style="padding-top:5px;text-align:center;color:#000000;">© 2003-2010 <br/>请使用最新的 IE 或者 FireFox 浏览器</div>

</div>

</body>

</html>

...全文
91 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
hellNo 2011-12-05
  • 打赏
  • 举报
回复

window.location.reload();

87,990

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧