i'm trying to get the data from my .json file (from the server) and just display it on the page. I'm not so good in the syntax of JS, i'm sorry.
I was trying to display only one parameter from the file but i don't see anything on the screen.
<html>
<head>
<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js">
</script>
<script>
$(function() {
$.getJSON("video.json", function(data)) {
$.each(data.NewsSources, function(i, f) {
var vid = f.Name;
$(vid).appendTo("#userdata");
});
});
});
</script>
</head>
<body>
<div id= "userdata">
<h1>This is a name</h1>
</div>
</body>
</html>
video.json
{
"NewsSources": [
{
"ID": 2004,
"Name": "365TV Brasil",
"Description": "",
"URL": "https://www.instagram.com/365scoresbra",
"Lang": 31,
"CountryID": 21,
"LogoUrl": "",
"ImgVer": 0
}
]
}