I have json file to store a number. I also have JS file to grab json data to be display in HTML.
As manual way to display is by put a number in XXX as below HTML code. So I want the data is dynamically get from back-end.
HTML
<span id="num"> XXX </span> number of users
JS
$(document).ready(function() {
var ajaxRequest;
console.log();
ajaxRequest= $.ajax({
url: "result/total.json",
type: "post",
dataType: 'json',
data: {'num':num},
});
});
JSON
{
"data": [
{
"num": "100"
}
]
}
getting orposting to this endpoint? What'snum?