E.root undefined in all.js

Does anyone know why I can get the following error:

e.root is undefined in all.js 

Not quite sure what is wrong with me here. Here is some part of my code.

 <script src="https://connect.facebook.net/en_US/all.js"></script> <script type="text/javascript"> window.fbAsyncInit = function() { FB.init({ appId : 'xxxxxxxxxxxxxxxxxx', // App ID channelURL : 'https://nowfoods.marketspacecom.com/channel.html', // Channel File status : true, // check login status cookie : true, // enable cookies to allow the server to access the session oauth : true, // enable OAuth 2.0 xfbml : true // parse XFBML }); // Additional initialization code here }; // Load the SDK Asynchronously (function(d){ var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;} js = d.createElement('script'); js.id = id; js.async = true; js.src = "//connect.facebook.net/en_US/all.js"; d.getElementsByTagName('head')[0].appendChild(js); }(document)); </script> </head> <body> <a href="javascript:fb_publish();" class="fbshare"><img src="images/share.gif" /></a> <script type="text/javascript"> //set the height of the canvas window.fbAsyncInit = function() { FB.Canvas.setSize({height: 1250}); } //this function will publish a post to the user wall function fb_publish() { // calling the API ... var obj = { method: 'feed', name: 'Get a free sample of <?php echo $getLatestPromoID['prodName']; ?> from NOW Foods!', link: '<?php echo $fbconfig['appBaseUrl']; ?>', picture: 'https://nowfoods.marketspacecom.com/images/nowicon.gif', caption: 'NOW Foods Free Samples', description: 'I just signed up for a free sample of NOW Foods <?php echo $getLatestPromoID['prodName']; ?>. You can get one too at the link above!' }; function callback(response) { document.getElementById('msg').innerHTML = "Post ID: " + response['post_id']; } FB.ui(obj, callback); } </script> <div id="fb-root"></div> </body> 

XXX XXX XX X XX X XXXXX X XXXX X XXX

XXX XXX XX X XX X XXXXX X XXXX X XXX

XXX XXX XX X XX X XXXXX X XXXX X XXX

XXX XXX XX X XX X XXXXX X XXXX X XXX

XXX XXX XX X XX X XXXXX X XXXX X XXX

+4
source share
1 answer

" <div id="fb-root"></div> " should appear before the script is enabled, I think ...

+6
source

Source: https://habr.com/ru/post/1385201/


All Articles