| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 973 人关注过本帖
标题:实现一进入网页就能定时读取下位机的数据的代码
只看楼主 加入收藏
icefox225
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2007-8-3
收藏
 问题点数:0 回复次数:3 
实现一进入网页就能定时读取下位机的数据的代码
<!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;'>
&copy;Copyright 1998-2013 by WIZnet Team
</div>
<script type='text/javascript' src='w5200.js'></script>
</body>
</html>
以上是我的一个网页的数据,我现在想实现WEB访问这个网页后能够定时的获取版本号,MAC地址,IP地址等,我现在搞不懂的是settingsCallback(o)这个函数都没调用,他怎么实现一访问页面就有数据出来的。
望大侠们来帮忙下,小弟没做过HTML编程。
搜索更多相关主题的帖子: display function PUBLIC return color 
2015-04-02 09:01
w123012306
Rank: 9Rank: 9Rank: 9
来 自:湖南
等 级:蜘蛛侠
威 望:4
帖 子:307
专家分:1180
注 册:2010-4-22
收藏
得分:0 
没调用就没有数据! 你自己跑一下试试就知道了!
要么就在其他地方调用了,比如可能你引用的w5200.js中

楼上,楼下的一定要幸福开心哦!
2015-04-02 11:35
冰镇柠檬汁儿
Rank: 16Rank: 16Rank: 16Rank: 16
来 自:北京
等 级:版主
威 望:120
帖 子:8078
专家分:6657
注 册:2005-11-7
收藏
得分:0 
<script type='text/javascript' src='w5200.js'></script>应该有调用吧

本来无一物,何处惹尘埃
It is empty at all here, Why pm 2.5 is so TMD high!
2015-04-02 21:56
快速回复:实现一进入网页就能定时读取下位机的数据的代码
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.017567 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved