jeudi 25 juillet 2019

How to call a javascript function from if statement of Laravel?

I want to call a javascript function from if statement of Laravel Blade. Is it possible?

@if(compareParent())
   Print Something
@endif

Javascript:

function compareParent() {
    $(".CategoryIDForModal").click(function () {
    var id = $(this).data(id);
    var parent_id = $('.subcategoryPID').text();

     console.log(id.id + " Parent: " + parent_id);
     if(id==parent_id)
    return true;
     else
    return false;
     })
}



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/32OqFW9
via IFTTT

Aucun commentaire:

Enregistrer un commentaire