I've read through multiple of these articles but nothing worked for me so would really appreciate if someone could assist. Im trying to display the Full_Name field into an HTML element on my webpage.
The PHP file is as follows:
{"Test_Info": {
"Company_Info": {
"Company_ID": "2",
"Company": "Test Company",
"Full_Name": "Test User"
}}
I'm using the below code in the body of my HTML code:
<body id="startscreenBG">
<div class="hello"> </div>
</body>
<script>
$.ajax({
type:'GET',
url:'jsondata.php',
data:'json',
success: function(data){
var newhtml = '';
$.each(data, function(i, item) {
newhtml +='<div>'+ item.Full_Name +'</div>';
});
$('.hello').html(newhtml);
}})
</script>
</html>