mardi 8 novembre 2016

Show logout button after login without refresh

I need to show logout button after login without page refresh. So far I am thinking of jquery's .show() and .hide() on success in ajax. But the problem is, the logout button is in another page, how to achieved this?

 @if(Auth::check())
    <a href="" class="btn-logout" id="logged">Logout</a>
 @endif

in ajax success

 success: function(data) { 
     console.log(data);
     $("#logged").show();
     var logg = $(find("#logged");
     console.log(logg)//object Object
     ......

I need to show logout button immediately after login



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire