I've got this piece of code:
$(document).ready(function () {
$.getJSON('http://localhost:5000/', function (response) {
console.log(response);
});
});
localhost:5000 is a flask/python
script that returns a json
like:
{
"data": [
0,
0,
0,
And I'm getting:
$.getJSON is not a function TypeError: $.getJSON is not a function
Any tips where I can start untangling the whoolball?
Thanks!
Edit:
HTML:
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-3.1.1.slim.min.js"></script>
<script src="lib/main.js"></script>
</head>
<body>
</body>
</html>
lib/main.js
is where the document.ready
is located.
Thanks!
jQuery
or you've calledjQuery.noConflict()
at some point before this (which means that you have to usejQuery
instead of$
from that point on.