2
I’m starting now and my question is simple, I have a function created within a class in a php file, and I want to get the return of that function in another javascript file, how do I do that? has something to see 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;
You are using jquery?
– Miguel
Yes, I’m using jquery.
– Robson Araújo
Utilize ajax according to @Miguel’s reply
– Matheus Czizeweski