<title>QuantiMotor</title>
<script type='text/javascript' src='/jquery-3.7.1.js'></script>
<script type='text/javascript'>
- $(document).ready(function()
- {
- $('button').on('click', function()
+ function updateContent()
{
var request = $.ajax({'url': '/getData'});
request.done(function(response)
{
alert('Request failed: ' + textStatus);
});
- })
- });
+ }
+
+ // update displayed data every second
+ setInterval(updateContent, 1000);
</script>
</head>
<body>
<h1>QuantiMotor</h1>
- <button>make ajax call</button>
<h2>Time</h2>
<div id='time'></div>
<h2>Pressure</h2>