I am trying to switch from a very basic webpage into anthor one but i face some issues with the result once i click on getAll
My previous webpage (the wroking one )
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
</head>
<body>
<button onclick="getAll()"> Get All The Users </button>
<div id="users"></div>
<script>
function getAll()
{
$("#users").html("");
$.getJSON("http://localhost:8080/users", function(data)
{
for (var i in data) {
$('#users').append("<p>ID: " + data[i].id + "</p>")
$('#users').append("<p>First name: " + data[i].fname + "</p>")
$('#users').append("<p>Last name: " + data[i].lname + "</p><br>")
}
});
}
</script>
</body>
</html>
Here is the error:
Uncaught ReferenceError: getAll is not defined
at HTMLButtonElement.onclick (testt.html:96)
onclick @ @ testt.html:96
testt.html:145
Uncaught ReferenceError: screenfull is not defined
at HTMLDivElement.<anonymous> (testt.html:145)
(anonymous) @ testt.html:145
EDITED After Nina´s answer i get the desired result but the homepage looks like this:
So it distorts the upper part of my homepage.