Can someone tell me what's wrong with my code? In chrome, i got error in console
Refused to display 'https://mobile.facebook.com/v2.7/dialog/oauth?...' in a frame because it set 'X-Frame-Options' to 'DENY'.
my facebook button is not working.
This my javascript
<script>
document.addEventListener('deviceready', this.onDeviceReady, false);
function onDeviceReady() {
}
window.fbAsyncInit = function() {
FB.init({
appId : 'myappid',
cookie : true, // enable cookies to allow the server to access
// the session
xfbml : true, // parse social plugins on this page
version : 'v2.7' // use graph api version 2.5
});
};
function fb_login(){
FB.login(function(response) {
if (response.authResponse) {
console.log('Welcome! Fetching your information.... ');
FB.api('/me', function(response) {
window.localStorage.setItem("loggedin", 1);
window.location.assign("3.html");
});
} else {
alert('User cancelled login or did not fully authorize.');
}
}, {scope: 'public_profile,email'});
}
// Load the SDK asynchronously
(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>
and this my html
<div id="fb-root"></div>
<button onclick="fb_login();">Facebook</button>
please help(sorry for my english)