Throwing an exception in JavaScript?
<p>My programming skills are not great, and I was hoping that someone would be able to guide me.</p>

<p>I am trying to integrate a predicted search function into a website, and i am using a JQuery plug-in to do so. I have got the search feature to work (the hardest part), and I just want to define a condition saying, if there are no products is stock displays “No match found” or whatever message. I just can’t get the condition to work, and I am running into syntax issues because I can even get the basic if else structure right.</p>

<p>Thank you for your time.</p>

<pre><code>$().ready(function() 
{

    $("#name").hide();

    if ($("#course").autocomplete("get_course_list2.php", {
        width: 260,
    }));

    $("#course").result(function(event, data, formatted) {
        $("#name").hide();
        $("#course_val").val(data[1]);
        result = "&lt;strong&gt; Product ID: &lt;/strong&gt;" + data[1] + "&lt;strong&gt; Product Name: &lt;/strong&gt;" + data[0]+ "&lt;strong&gt; &lt;/strong&gt;";
        result += "&lt;a href=\"http://restoftheurl?id="+data[1]+"\"&gt;Click Here to view the product&lt;/a&gt;";
        $("#name").html(result);



    });

});
</code></pre>
