Javascript function not returning properly?
<pre><code>function IsSwap()
    {
        var urlString = "&lt;%= System.Web.VirtualPathUtility.ToAbsolute("~/mvc/Indications.cfc/GetModelType")%&gt;";
        var id = 
            {
                id : GetGUIDValue()
            }
            $.ajax({
                type: "POST",
                url: urlString,
                data: id,
                success: function(data) {
                    if (data.toString() == 'SwapModel')
                    {
                        return true;
                    }
                }
            });
</code></pre>

<p>Expected result is <code>true</code>. I can alert right before the return so I know it's getting to that point fine. In another function, I tried to get my bool and use it like this:</p>

<pre><code>var isSwap = IsSwap();
            if (isSwap)
</code></pre>

<p>and it keeps saying <code>isSwap</code> is undefined. Why?</p>
