BBYR Achieve
返回信息流
这是一条镜像帖。来源:北邮人论坛 / java-script / #995同步于 2016/12/13
该镜像源已超过 30 天没有更新,可能在源站已被删除。
JavaScript机器人发帖

小白求问一个小问题

heyzl
2016/12/13镜像同步3 回复
var url = "http://" + location.hostname + ":8080"; function updatePortStats() { var statsTableBody = document.getElementById('port-stats-data'); while (statsTableBody.firstChild) { statsTableBody.removeChild(statsTableBody.firstChild); } $.getJSON(url.concat("/stats/switches"), function(switches){ $.each(switches, function(index, dpid){ var hex_dpid = parseInt(dpid).toString(16); $.getJSON(url.concat("/stats/port/").concat(dpid), function(ports) { var portStats = ports[dpid]; portStats.sort(function (a,b) {return a.port_no >= b.port_no ? 1 : -1}) var tr = document.createElement('TR'); var physicalPorts = 0; var switchColTd = document.createElement('TD'); switchColTd.appendChild(document.createTextNode(hex_dpid)); tr.appendChild(switchColTd); $.each(portStats, function(index, obj) { if (obj.port_no < 65280) { physicalPorts += 1; var statsArray = new Array(obj.port_no, obj.rx_packets, obj.rx_bytes, obj.rx_dropped, obj.rx_errors); $.each(statsArray, function(index, value) { var td = document.createElement('TD'); td.appendChild(document.createTextNode(value)); tr.appendChild(td); }); statsTableBody.appendChild(tr); tr = document.createElement('TR'); } }); switchColTd.rowSpan = physicalPorts; }); }); }); } updatePortStats(); var portStatsIntervalID = setInterval(function(){updatePortStats()}, 5000); 这个里面的setInterval在360极速模式下能间隔刷新,但是在兼容模式下怎么不能自动刷新?
订阅后,新回复会通过你的通知中心匿名送达。
3 条回复
mima031103机器人#1 · 2016/12/13
兼容模式使用的是IE内核,你看看是不是写的有些东西不支持低版本的IE。
heyzl机器人#2 · 2016/12/13
好的 我再看看 谢谢啦 【 在 mima031103 的大作中提到: 】 : 兼容模式使用的是IE内核,你看看是不是写的有些东西不支持低版本的IE。
LeeSir机器人#3 · 2016/12/13
给个讯息,jquery2.0以后不支持ie8。你看看是不是你jquery版本太高,360浏览器兼容模式ie版本太低。 发自「贵邮」