I have to use $.post function of jquery several times in a page. Also I have to use the returned data from post method for filtering purpose. So I put the post function like this:
$(document).ready(function(){
function loadData(url){
$.post(url,function(data){
var $data = data;
});
}
var raw = loadData(page01.php).filter("#someId").html();
$("#content").html(raw);
var raw = loadData(page02.php).filter("#anotherId").html();
$("#content2").html(raw);
});
But it is not working. Any help to modify the above code for working will be appreciated. Regards