Skip to content Skip to sidebar Skip to footer

Javascript Asynchronous

I have some 3 methods. login(); isLogin(); reply(); function isLogin(){ FB.getLoginStatus(function(response) { if (response.session) { // logged in and connected user

Solution 1:

you need to construct conditions that will handle the following:

When a user will want to reply a comment

  1. Check session if user isLogin()
    • if TRUE then reply method is enabled by default
    • if FALSE then call login() method via ajax for awesomeness
      • if login.success then call reply method
      • if login.failed add statement here

Post a Comment for "Javascript Asynchronous"