Need help with my code in javscript

I have created this api
image
this is my simple code in other localhost file.
But it is not fetching the necessary data.
please help

<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" ></script>
<script>
function starter()
{
$.getJSON('http://localhost:8080/data.JSON',function(data)
{
  $("#root").text(data.user_details[0].name);
});
}
</script>
</head>
<body onload="starter()">
<div id="root"></div>
<!--<iframe src="http://localhost:8080/data.JSON"></iframe>
-->
</body>
</html>

Are you getting any errors in the console?

No,
Local host is working fine.

What happens when you console.log(data) inside the $.getJSON callback?

I have the solution thanks