我使用fancybox的模式框和iFrame。从形式的iFrame成功我使用下面的代码:使用jquery刷新iframe的父页上的div
<script type="text/javascript">
window.setTimeout('window.top.location.href = "/page.asp"; ',999);
</script>
<script language="javascript">
<!--
setTimeout("parent.$.fancybox.close();",1000)
//-->
</script>
该关闭的fancybox的模式对话框并刷新父页面。我想定位一个div来使用Jquery在iFrame的父页面上刷新。
我想在父页面上用id =“target”刷新目标DIV,而不是整个页面。我如何使用JQuery去解决它?
TIA
代码示例如下
父页
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
</head>
<body>
<div id="target">
content content
</div>
</body>
</html>
的iFrame网页在表单验证
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
</head>
<script type="text/javascript">
window.setTimeout('window.top.location.href = "/parent_page.asp"; ',999);
</script>
<script language="javascript">
<!--
setTimeout("parent.$.fancybox.close();",1000)
//-->
</script>
如何让父页面上的功能刷新div id =“target”并从iFrame中调用它。现在,整个父页面刷新。
您能否提供一个完整的示例,其中包含一些DIV示例以及您想要“刷新”的具体描述以及“刷新”对您有什么影响?我怀疑你想要的是在AJAX中重新加载页面,将新的HTML传递给jQuery,并使用'.remove()'和'.html(new_html)'新的DIV内容到现有的DIV中。 – 2011-05-27 17:49:12
我试图用你提到的无效的谷歌搜索解决方案。我将如何去完全使用AJAX来做这件事? – Patriotec 2011-05-28 03:54:05