【发布时间】:2015-05-04 17:22:08
【问题描述】:
我知道解决这个问题的方法,但这是错误的方法,涉及创建一个新文件并作弊。
现在的问题:
- 我有一个包含 index.html 文件的文件夹;这个文件有一个菜单,其中有一个
<a href="reg_interlocutor.html"> -
在 reg_interlocutor.html 我使用 div 并在其中一个中调用注册表:
这会将文件 form_registo_interlocutor.html 的内容插入到 div 中,并将用户插入的数据发送到名为的文件夹中的文件 reg_interlocutor.php php;
-
在这个文件reg_interlocutor.php中,当我使用的数据有问题时
echo "<script>alert('blablabla.'); window.location = '../index.html';</script>";
但如果一切顺利,我想重新加载 index.html。
问题是浏览器将 index.html 重新加载到我自 第 2 步以来使用的同一个 div 中。
实际上,tab url 保持不变:localhost/proj/reg_interlocutor.html 自 step_2 以来的每一步。
我已经用过:
header('window-target: main');
header('location:../index.html');
<script>top.window.location='../index.html';</script>
window.open("http://localhost/proj/index.html","_self");
谁能帮帮我?我知道我的代码卡在 div 上,这就是为什么在该 div 内打开索引文件的原因。
【问题讨论】:
标签: javascript php html url dom