实现一进入网页就能定时读取下位机的数据的代码
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.\'><html>
<head>
<title>Parameter Setup!</title>
<style type='text/css'>
body {text-align:left; background-color:/*#ffc1e0*/#c0deed;font-family:Verdana;}
#main {margin-right:auto;margin-left:auto;margin-top:30px;}
label{display:inline-block;width:150px;}
#main h3{color:#66b3ff; text-decoration:underline;}
</style>
<script>
function $(id) { return document.getElementById(id); };
function settingsCallback(o) {
if ($('txtVer')) $('txtVer').value = o.ver;
if ($('txtMac')) $('txtMac').value = o.mac;
if ($('txtIp')) $('txtIp').value = o.ip;
if ($('txtSub')) $('txtSub').value = o.sub;
if ($('txtGw')) $('txtGw').value = o.gw;
};
</script>
</head>
<body>
<div id='main'>
<div style='background:snow; display:block;padding:10px 20px;'>
<h3>Device Settings</h3>
<form id='frmSetting' method='POST' action='config.cgi'>
<p><label for='txtIp'>Firmware version:</label><input type='text' id='txtVer' name='ver' size='16' disabled='disabled' /></p>
<p><label for='txtIp'>MAC address:</label><input type='text' id='txtMac' name='mac' size='16' disabled='disabled' /></p>
<p><label for='txtIp'>IP address:</label><input type='text' id='txtIp' name='ip' size='16' /></p>
<p><label for='txtSub'>Subnet mask:</label><input type='text' id='txtSub' name='sub' size='16' /></p>
<p><label for='txtGw'>Default gateway:</label><input type='text' id='txtGw' name='gw' size='16' /></p>
<p><input type='submit' value='Save Settings and Reboot' /></p>
</form>
<h3>Firmware Updating</h3>
<form id='frmFirmware' method='post' action='firmware.cgi' enctype='multipart/form-data'>
<p><input type='file' id='txtFile' size='32' name='fwfile' value='' accept='binary/bin' /><input type='submit' value='Upload'></p>
</form>
</div>
</div>
<div style='margin:5px 5px;'>
©Copyright 1998-2013 by WIZnet Team
</div>
<script type='text/javascript' src='w5200.js'></script>
</body>
</html>
以上是我的一个网页的数据,我现在想实现WEB访问这个网页后能够定时的获取版本号,MAC地址,IP地址等,我现在搞不懂的是settingsCallback(o)这个函数都没调用,他怎么实现一访问页面就有数据出来的。
望大侠们来帮忙下,小弟没做过HTML编程。