Object is always null

Hi all

I am trying to handle some problem but my variable always return null.

here is my code

[code] var myVar = App.Match.Detail(demands[0]);

console.log(myVar);
App.Match.Pops[i].attachHTML(myVar);

Detail : function(id)
{
    // Talep Detaylar
    dhtmlxAjax.post("/api/demand/extra", "id=" + id, function(loader){
        var json_res = JSON.parse(loader.xmlDoc.responseText);

		...
		...
		...
		
		return html;

        }
    });
}[/code]

in this code myVar always null.

Code keeps working and it is not waiting data from Detail function therefor, when code reach to App.Match.Pops[i].attachHTML(myVar); automatically myVar became null.

How can i force my code to wait response from Detail function?

Regards

Seriously? No answer?