get data from ajax as an attribute value for callback function
<p>Im new to ajax. I was trying to find the answer but was not lucky to find the corresponsing one. Basically I need to use an ajax to get some data and after that to put this data to the variable that later will be used as an attribute for the callback function with custom code.</p>

<p>This ajax part is just a method of myObject.</p>

<p>So, in the end I need this kind of functionality:</p>

<pre><code>myObject.getData(url, callback(data) {
//my custom code of what I wanna do after ajax is complete
});
</code></pre>

<p>My code </p>

<p>/*
HERE COME SOME PROPERTIES AND OTHER METHODS WICH IS NOT THE CASE
*/</p>

<pre><code>//This is where Im stuck
var getData = function getFromUrl($url) {
         $.ajax({
                type: 'get',
                url: $url,
                dataType: 'html',
                success: function(html) {
                        $obj = html;//Im lost on this step!
                            },
        });
};

P.S. Im trying to find an async way (without using async:false). Hope its possible
</code></pre>