I'm sending JQUERY $.post request to my php method, it looks like that:
$.post("/controller/method/",{id: cell_id},function(data,status,xhr)
{
some_javascript_function();
})
PHP:
public function method()
{
insert to database code...
}
my PHP function just insert a record into table, which some_javascript_function() will use - cause it request data from database. Sometimes my PHP function is too slow to insert record before some_js_function() tries to get it from database.
Hoe can I manage some response from PHP when everything is ready, and then call some_js_function?