Ajax function , or ) expected : <p>So I'm following a tutorial trying to implement an Ajax search form on my site, my Ajax.js looks as follows:</p>

<pre><code>$(funcrion () {
$('#search').keyup(function () {
    $.ajax({
        type: "POST",
        url: "/cooks/search/",
        data: {
            'search_text': $('#search').val(),
            'csrfmiddlewaretoken': $("input[name=csrfmiddlewaretoken]").val()
        },
        success: searchSuccess,
        dataType: 'html'
    });
});
});
</code></pre>

<p>From what I understood the first bit is to make sure the search function doesn't run before the page loads.
I'm getting a ", or ) expected " error although the syntax seems to match the tutorials.</p>

<p>mind that I have an on load function on my base.html (don't know if that's related)</p>

<pre><code> $( window ).on( "load", function() {
            console.log( "window loaded" );
        });
</code></pre>

<p>What am I missing here?</p>

<p>ps.
I don't want massive lines of code on my HTML for the ajax so I rather have a separate js file for that</p>
