【发布时间】:2015-05-28 10:59:18
【问题描述】:
第 1 页:tabeloverzicht.php
<!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=utf-8" />
<title>Tabel overzicht</title>
<link href="../css/templatemo_style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../css/jquery-1.9.1.js"></script>
<script type="text/javascript">
$(function() {
$(document).ready(function() {
$.get(
'tabel.php',
function(response){
$('#tabelplaats').html(response);
}
);
});
$(window).click(function(event){
$.get(
'tabel1.php',
function(response){
$('#tabelplaats').html(response);
}
);
});
});
</script>
</head>
<body>
<div id="tabelplaats">
</div>
</body>
</html>
第2页:tabel.php
<!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=utf-8" />
<link href="../css/templatemo_style.css" rel="stylesheet" type="text/css" />
<title>Tabel Processor</title>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=600,h eight=500,left = 200,top = 200');");
}
// End -->
</script>
</head>
<body>
<table>
<tr>
<th>Hallo</th>
<th>dit</th>
<th>is</th>
</tr>
<tr>
<td>een</td>
<td>test</td>
<td><a HREF="javascript:popUp('popup.php')"><div id="modify" class="buttonsmall"><button id="BedrijfAanpassen" class="button" name="modify"><i class="icon-pencil icon-small"></i></button></div></a></td>
</tr>
</table>
</body>
</html>
第 3 页:Tabel1.php
<!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=utf-8" />
<link href="../css/templatemo_style.css" rel="stylesheet" type="text/css" />
<title>Tabel Processor</title>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=600,height=500,left = 200,top = 200');");
}
// End -->
</script>
</head>
<body>
<table>
<tr>
<th>Test</th>
<th>test</th>
<th>test</th>
</tr>
<tr>
<td>test</td>
<td>test</td>
<td>test</td>
</tr>
</table>
</body>
</html>
第4页:popup.php
不管这个页面上的什么。
Tabeloverzicht 是主页。这是显示的表格。该表格包含一个打开弹出窗口的按钮(在我的应用程序中,您可以在弹出窗口中更改表格的某些值)当弹出窗口关闭时,他需要更新父窗口中的表格。 window.opener.reload(true) 对我不起作用,因为主页上还有许多其他选项也会被重置。我只需要更新顶表。
在我的应用程序中还有第二个表格,根据打开的弹出窗口,他需要刷新第一个或第二个表格。
希望任何人都可以提供帮助,因为我已经被这个问题困扰了好几天了......
提前致谢!
【问题讨论】:
-
假设表中的值来自数据库,您需要执行 AJAX 调用来更新该特定表。查看此链接了解更多详情:(stackoverflow.com/questions/12458540/…)。
-
你能不能用一些小东西来总结一下,而不是把所有的东西都扔掉。 :)
标签: javascript php jquery window