First try AJAX
This commit is contained in:
@@ -1,4 +1,7 @@
|
|||||||
function kebab () {
|
$('#update').click(updateData())
|
||||||
$('#values').html('kebab');
|
function updateData () {
|
||||||
console.log('yeet');
|
const url = 'http:' + window.location.hostname + ':5000/data'
|
||||||
|
$.get(url, function (data, status) {
|
||||||
|
$('#debug').text(data)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
+13
-6
@@ -1,16 +1,22 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
|
||||||
|
<head>
|
||||||
<meta charset="utf8">
|
<meta charset="utf8">
|
||||||
<link rel="stylesheet" href="lib/bootstrap.min.css">
|
<link rel="stylesheet" href="lib/bootstrap.min.css">
|
||||||
<link rel="stylesheet" href="stylesheet.css">
|
<link rel="stylesheet" href="stylesheet.css">
|
||||||
<title>TeraHz</title>
|
<title>TeraHz</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
|
||||||
<div class="container text-center"><h1>TeraHz</h1></div>
|
<body>
|
||||||
|
<div class="container text-center">
|
||||||
|
<h1>TeraHz</h1>
|
||||||
|
</div>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<h3>Vrednosti:</h3><br>
|
<h3>Vrednosti:</h3><br>
|
||||||
<button class="btn btn-primary m-1 float-right">Get data</button>
|
<button id="update" class="btn btn-primary m-1 float-right">Get data</button>
|
||||||
|
<p id="debug">
|
||||||
|
</p>
|
||||||
<table class="table table-sm">
|
<table class="table table-sm">
|
||||||
<thead class="thead-dark">
|
<thead class="thead-dark">
|
||||||
<tr>
|
<tr>
|
||||||
@@ -115,5 +121,6 @@
|
|||||||
<script src="lib/bootstrap.bundle.min.js"></script>
|
<script src="lib/bootstrap.bundle.min.js"></script>
|
||||||
<script src="lib/jquery-3.3.1.min.js"></script>
|
<script src="lib/jquery-3.3.1.min.js"></script>
|
||||||
<script src="frontend.js"></script>
|
<script src="frontend.js"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Reference in New Issue
Block a user