get $.ajax response
<pre><code>function Profiles() { };

Profiles.prototype.test = function() {
    var opt = {
     url: __profileurl__+'getall/', type: 'get', dataType:'json',
     success:function(response){
       return response;
     }
    };    
    $.ajax(opt);
};

var profile = new Profiles(); 

var r = profile.test();
</code></pre>

<p>// returns undefined... expected output should be the response from the request.</p>
