Need help with my code in javscript

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

<script src="" ></script>
function starter()
<body onload="starter()">
<div id="root"></div>
<!--<iframe src="http://localhost:8080/data.JSON"></iframe>

Are you getting any errors in the console?

Local host is working fine.

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

I have the solution thanks