İlk örneğini Facebook JS SDK belgelerinden çalıştırmaya çalışıyorum. Yeni bir uygulama oluşturdum, "facebookTest.html" adlı bir örnek oluşturdum, örneğin kodun içine yapıştırdım ve yeni uygulamanın App ID'sine takılıyorum. Kod aşağıdaki gibi:Facebook'un örnek kodunu kullanarak kaynak "Kaynak yüklenemedi"
Failed to load resource
yanlış yapıyorum:
<html>
<head>
<title>Login with facebook</title>
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
// init the FB JS SDK
FB.init({
appId : 'my app ID', // App ID from the App Dashboard
status : true, // check the login status upon init?
cookie : true, // set sessions cookies to allow your server to access the session?
xfbml : true // parse XFBML tags on this page?
});
// Additional initialization code such as adding Event Listeners goes here
};
// Load the SDK's source Asynchronously
// Note that the debug version is being actively developed and might
// contain some type checks that are overly strict.
// Please report such bugs using the bugs tool.
(function(d, debug){
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 = document.location.protocol+"//connect.facebook.net/en_US/all" + (debug ? "/debug" : "") + ".js";
ref.parentNode.insertBefore(js, ref);
}(document, /*debug*/ false));
</script>
ben aşağıdaki hata mesajı alıyorum JavaScript konsolu, sayfa yüklediğinizde?
DÜZENLEME: önerdi here olarak, "//connect.facebook.net/..."
önce document.location.protocol
eklediğinizde, ekran boş kalır ve konsol aşağıdakileri gösterir:
GET file://connect.facebook.net/en_US/all.js
tüm bu kod yapmak gerekiyordu mı? Yoksa hala başarısız mı? Burada yanlış bir kaç şey vardı
sizin AdBlock'u kontrol için çalışıyor! :) – FooBar