I'm starting now and my question is simple, I have a function created inside a class in a php file, and I want to get the return of that function in another javascript file, how do I do this? has something to do with ajax request?.
Php file, the function is something like this
public function minhaFunção()
{
[..]
if($data!=0)
{
$prerollModel->prerollCount();
$TemId = true;
}
else
{
$TemId = false;
}
return $TemId;
}
js file
var retorno = o retorno da função;