John D. Doucette John D. Doucette -4 years ago 126
Javascript Question

How to load facebook sdk asynchronous

I am using the following code to share in facebook.

<div id="fb-root"></div>
window.fbAsyncInit = function() {
appId : "1549906631990069",
status : true,
cookie : true,
xfbml : true,

oauth: true,
frictionlessRequests : true

(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;

js = d.createElement(s); = id;
js.src = "//";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));


After that I have one image on clicking that Image the facebook share popup is coming.

<script type="text/javascript">
function shareOnFacebook() {
var $temp = $(".wpProQuiz_points").find("span");
var scored = $temp.eq(2).text();

method : 'feed',
display : 'iframe',
name : 'I have Scored '+ scored + ' in edumongoose quiz.',
link : ''
function(response) {
if (response && response.post_id) {
alert('OK! User has published on Facebook.');

} else {
alert('Post was not published.');


the work good in chrome and firefox normal window, But when I goes in private window it show in error :
The resource at "" was blocked because tracking protection is enabled.

what wrong am I doing ?

Answer Source

This isn't your fault! The browser is checking all downloaded script files against a list of scripts known to send tracking information back to the server. In incognito or in private mode, browsers tend to block these scripts for privacy reasons.

A bug report has been raised against Firefox at

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download