Blazor

How do I load a JSON file in the client-side of the Blazor app without making a request to server?

How do I load a JSON file in the client-side of the Blazor app without making a request to server?

To load a JSON file in Blazor, refer to the following code.

<script src="https://code.jquery.com/jquery-3.4.1.min.js"
        integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo="
        crossorigin="anonymous"></script>
<script type="text/javascript" src="object.json"></script>
<script>
    $.getJSON("object.json", function (json) {
        console.log(json); 
    });
</script>
Sumitra Kumari Shaw

An Engineering graduate who Enjoys building things that live on the internet.