我有这个运行良好的 HTML。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<script language="JavaScript"><!--
function refreshIt() {
if (!document.images) return;
var myImage = document.getElementById('signals');
myImage.src = 'http://lessthanrandom.com/screencast/signals.jpg?' + Math.random();
setTimeout('refreshIt()', 900000); // refresh every 60 seconds
//setTimeout('refreshIt()', 1800000); // refresh every 1/2 hour
}
//--></script>
<style>
*{margin:0;padding:0}
html, body {height:100%;width:100%;overflow:hidden}
table {height:100%;width:100%;table-layout:static;border-collapse:collapse}
iframe {height:100%;width:100%}
.header {border-bottom:1px solid #000}
.content {height:100%}
</style>
</head>
<body onLoad="setTimeout('refreshIt()', 900000)">
<table>
<tr><td class="content">
<img src="http://lessthanrandom.com/screencast/signals.jpg" width="100%" id="signals" name="signals"></td></tr>
</table>
</body>
</html>
如果我在上面添加以下 PHP 并更改为 PHP 文件,图像会显示,但不会刷新。我是 PHP 和 Javascript 的新手。
<?php
include_once "/home/lesadmin/public_html/wp-load.php";
if (current_user_can("access_s2member_level1"))
{
}
else
exit("Must have a valid membership to view this content.");
?>