setInterval to update at random time, within the second half of the minute. e.g. to help spread server load
If FAIL, set time-out to ensure PASS If PASS, set interval to reload every 60 seconds
*View browser console for feedback
xxxxxxxxxx
<html lang="en">
<head>
<meta charset="utf-8">
<title>d3 | update chart</title>
<meta name="author" content="Sundar Singh | eesur.com">
<script src="https://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.3/moment.min.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/lodash.js/3.9.3/lodash.min.js"></script>
<style type="text/css">
@import url(https://fonts.googleapis.com/css?family=Source+Code+Pro:400,600);
body {
font-family: "Source Code Pro", Consolas, monaco, monospace;
line-height: 1.5;
font-weight: 400;
background-color: #130C0E;
padding: 20px;
}
#current-seconds {
list-style: none;
margin: 0;
padding: 0;
margin-top: 30px;
}
#current-seconds li {
padding: 4px 8px;
margin-bottom: 8px;
background: #00B0DD;
letter-spacing: 1px;
}
</style>
</head>
<body>
<ul id="current-seconds"></ul>
<script src="d3_code_updatechart.js" charset="utf-8"></script>
</body>
</html>
Modified http://d3js.org/d3.v3.min.js to a secure url
https://d3js.org/d3.v3.min.js
https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.3/moment.min.js
https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.9.3/lodash.min.js