javascript - can't login to facebook with parse -


i'm trying add facebook login option website , want login parse account.

i've added followed scripts:

1) after tag inside index.html:

<script>   // initialize parse   parse.initialize("**********************", "*****************************");        window.fbasyncinit = function() {     parse.facebookutils.init({ // line replaces fb.init({       appid      : '{******************}', // facebook app id       status     : true,  // check facebook login status       cookie     : true,  // enable cookies allow parse access session       xfbml      : true,  // initialize facebook social plugins on page       version    : 'v2.3' // point latest facebook graph api version     });          // run code after facebook sdk loaded.    };        (function(d, s, id){     var js, fjs = d.getelementsbytagname(s)[0];     if (d.getelementbyid(id)) {return;}     js = d.createelement(s); js.id = id;     js.src = "//connect.facebook.net/en_us/sdk.js";     fjs.parentnode.insertbefore(js, fjs);   }(document, 'script', 'facebook-jssdk')); </script> 

2)log in function inside login.js:

function loginwithfacebook(){  parse.facebookutils.login(null, {   success: function(user) {     if (!user.existed()) {       alert("user signed , logged in through facebook!");     } else {       alert("user logged in through facebook!");     }   },   error: function(user, error) {     alert("user cancelled facebook login or did not authorize.");   } }); } 

and of course 2 lines in tag in index.html:

<script src="//www.parsecdn.com/js/parse-1.4.2.min.js"></script> <script src='login.js'></script> 

3) , have simple tag have onclick attribute:

<a href="#" onclick="loginwithfacebook();">log in</a> 

however, when click on it, nothing happens, none of messages inside loginwithfacebook function appears. in face, none of messages inside parse.facebookutils.login appears, cause when alert message before call parse.facebookutils.login appears...


Comments

Popular posts from this blog

node.js - Using Node without global install -

How to access a php class file from PHPFox framework into javascript code written in simple HTML file? -

java - Null response to php query in android, even though php works properly -