samedi 18 avril 2015

Javascript facebook sdk login local

i've got this Facebook login in sdk it works fine on my server but i need to use it in local path (file://path) when user is online, but it doesn't work, i click the button without any effect this is the code



<html>
<head>
<link rel="stylesheet" type="text/css" href="../css/style.css">
<meta name="viewport" content="width=320, initial-scale=0.7, user-scalable=no">
<script src="JS/jquery-1.11.1.js.js"></script>
<link rel="stylesheet" type="text/css" href="../css/login.css">
<script>
window.fbAsyncInit = function() {
FB.init({
appId : 'MYAPPID', // App ID
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});


FB.Event.subscribe('auth.authResponseChange', function(response)
{
if (response.status === 'connected')
{
window.location.replace("gestaccount.html");
}
else
{

}
});

};

function Login()
{

FB.login(function(response) {
if (response.authResponse)
{

} else
{
window.location.replace("errorconn.html");
}
},{scope: 'email,user_photos,publish_actions'});


}


// Load the SDK asynchronously
(function(d){
var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
ref.parentNode.insertBefore(js, ref);
}(document));

</script>
</head>

<body style=" background: #2c3338;
color: #606468;
margin: 0;">

<div id="navigation">
<table width="100%">
<tr valign="bottom">
<td valign="middle" width="25%" align="center">
<a href="eventi.php"><img src="IMG/icon/prvs.png" class="icons3"/></a>
</td>
<td valign="bottom" width="50%" align="center">
<img src="IMG/LOGO-WHITE.png" class="logonbar" alt="DONUT"/>
</td>
<td width="25%" align="center" valign="middle">

</td>
</tr>
</table>

</div>
<div id="fb-root"></div>


<br>
<div class="containerlogin">
<br><br><br><br><br>



<div id="login" style="display: block; margin:0 auto;" >

<img src="../IMG/LOGIN.png" class="iconlogin" alt="" style="display: block; margin: 0 auto;"/>


<p> <button type="submit" name="fb" onClick="Login()" class="button"> </button>


<p style="margin-left:25px;">Loggati e avrai la possibilità di tenere controllati
tutti le tue prenotazioni tra prevendite e tavoli.
Inoltre se sei PR contattaci per avere accesso a tutte
le funzionalità riservate. </p>
</div> <!-- end login -->

</div>

<br>
<br>
</div>




</div>



</body>
</html>


Thank you for answer.


Aucun commentaire:

Enregistrer un commentaire