Uncaught ReferenceError: $ is not defined
<p>hello i am trying to link these js codes into my webpage with the code on the php as this:</p>

<pre><code>&lt;script src="./js/main.js" type="text/javascript"&gt;&lt;/script&gt;
</code></pre>

<p>this is the code and its coming with this error Uncaught ReferenceError: $ is not defined </p>

<pre><code>    $(function() {
        var pull        = $('#pull');
            menu        = $('nav ul');
            menuHeight  = menu.height();

        $(pull).on('click', function(e) {
            e.preventDefault();
            menu.slideToggle();
        });

        $(window).resize(function(){
            var w = $(window).width();
            if(w &gt; 320 &amp;&amp; menu.is(':hidden')) {
                menu.removeAttr('style');
            }
        });
    });

$(document).ready(function(){ 

    $(window).scroll(function(){
        if ($(this).scrollTop() &gt; 500) {
            $('.scrollup').fadeIn();
        } else {
            $('.scrollup').fadeOut();
        }
    }); 

    $('.scrollup').click(function(){
        $("html, body").animate({ scrollTop: 0 }, 600);
        return false;
    });

});
</code></pre>

<p>thanks</p>
