I am trying to GET some JSON data from the following url. I am having trouble making this work.
You see, I am trying to integrate the school's lunch menu through NutriSlice. We are using a digital signage system called RiseVision, and they have an HTML widget. This, of course, means I can only use HTML and JavaScript - makes things more difficult for me.
My code is as follows:
<!DOCTYPE html>
<html>
<head lang="en">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="UTF-8">
<script src="https://code.jquery.com/jquery-2.2.0.js"></script>
</head>
<body>
<div>test</div>
<script>
$.ajax({type: "get",
url: "https://brf.nutrislice.com/menu/api/digest/school/black-river-falls-high-school/menu-type/lunch/date/2018/10/16/",
data: {method: "getQuote",format: "json",lang: "en"},
dataType: "jsonp",
jsonp: "jsonp",
jsonpCallback: "myJsonMethod"
});
function myJsonMethod(response){
$("div").append(" " + response);
}
</script>
</body>
</html>
Nothing ever works for this. Nothing gets returned. Why? I'm not sure what I am doing wrong. The link I attached above shows the Django page for the API I'm looking at here.
Your help is very much appreciated! :)
EDIT:
var obj = jQuery.parseJSON( response );
$("div").append(" " + obj.menu_items[0]);
Further clarification: Here is an example JSON from the data I need.
{"date":"2018-10-16","menu_items":["Taco Meat","Shredded Cheddar","Tortilla Chips","Tortilla Shell"],"images":["https://client-food-images.nutrislice.com/images/WD/WDeTEDdT2YDit97pdpUq7T/1474319790_787275__taco.jpg.1024x0_q85.jpg","https://client-food-images.nutrislice.com/images/eR/eRQamewxbJbFdAAbkUa5UK/1472157292_144997__ShrededCheddarCheese-IGH.jpg.1024x0_q85.jpg","https://client-food-images.nutrislice.com/images/4N/4NrHbqSdtFSa9HjQTM4WwT/1472157795_18851__tortillachips-m.jpg.1024x0_q85.jpg","https://client-food-images.nutrislice.com/images/wx/wx7bT4QGjLD8wNuK9oMtki/1473879858_737966__tortilla.jpg.1024x0_q85.jpg"],"holiday_text":null}