it shows uncaught referenceError :$ is not defined. whats the exact matter cant understand

<!doctype html>
<html>
    <head>
        <meta charset="UTF-8">
        <script type="application/json" src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
        <style>
            th{
                font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
                font: bold;
                text-align: center;
            }
            td{
                font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
                text-align: center;
            }
        </style>
    </head>
    <body>
        <section>
            <h1>Json data to HTML table</h1>
            <table id="JsonTable" style="table-layout: auto; border: 2px solid black;">
                <tr style="border: 1px solid red;">
                    <th>UserID</th>
                    <th>ID</th>
                    <th>Title</th>
                    <th>Body</th>
                </tr>
            </table>
            <script>
                $(document).ready(function(){
                    $.getJSON("https://jsonplaceholder.typicode.com/posts",function(data){
                        var task='_';
                        $.each(data,function(key,value){
                            task +='<tr>';

                            task +='<td>'+ value.userId +'</td>';

                            task +='<td>'+ value.id +'</td>';

                            task +='<td>'+ value.title +'</td>';

                            task +='<td>'+ value.body +'</td>';

                            task +='</tr>';
                        })
                        $('#JsonTable').append(task);
                    })
                })
            </script>
        </section>
    </body>enter code here
</html>

whats the matter i cant understand. it shows on the 30th line uncaught referenceError :$ is not defined.
i tried finding the solution but still its giving the error. please help what to do. i am a fresher in jquery and ajax.

34 thoughts on “it shows uncaught referenceError :$ is not defined. whats the exact matter cant understand”

  1. 637427 886017The the next occasion Someone said a weblog, Hopefully so it doesnt disappoint me approximately this. What im saying is, I know it was my choice to read, but I really thought youd have something fascinating to express. All I hear is often quite a few whining about something that you could fix in case you werent too busy searching for attention. 217397

    Reply

Leave a Comment