Facebook Page Plugin appears as link only on website

帅比萌擦擦* 提交于 2019-11-27 08:45:33

问题


I have seen similar posts, but haven't found an answer. I am rebuilding my website using Bootstrap and would like to add the new Page Plugin. I have followed all the instructions, inserting the Javascript code after the opening tag and inserting the other code into my web page. All that appears on my webpage is a link that reads "KMC Marine", which DOES go to my Facebook page, but no other plugin data appears.

Any suggestions would be greatly appreciated.


回答1:


1) put following css code, it will solve your problem

<style type="text/css">
    .fb_iframe_widget span{        
        overflow: initial !important;
    }
    .fb_iframe_widget iframe{        
        width: 340px !important;
        height: 500px !important;    
    }
</style>

2) if you are running your website locally you have to replace

js.src = "//connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v2.4";

with

js.src = "https://connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v2.4";



回答2:


Try putting the JS code before the ending body tag as opposed to after the opening tag.




回答3:


I have the same problem.

I did like you did, included the sdk Javascript right after the body tag (and before, or on a separate javascript file, anywhere else, doesn't matter, still doesn't work!!!) and I placed the code of my plugin where I want it to appear.

I had this error in the browser console :

GET file://connect.facebook.net/fr_FR/sdk.js net::ERR_FILE_NOT_FOUND(anonymous function)

So I tried to change this :

    js.src = "//connect.facebook.net/fr_FR/sdk.js#xfbml=1&version=v2.4"; 

into this :

   js.src = "http://connect.facebook.net/fr_FR/sdk.js#xfbml=1&version=v2.4";

The SDK now seems to load but I have a new error in the console :

Invalid App Id: Must be a number or numeric string representing the application id. (sdk.js, line 64).

You can still try this. Maybe it'll work for you.




回答4:


It turned out that my problem was that I hadn't uploaded the site to the web. I was simply testing the site in a browser before uploading. Once I uploaded it, the plugin worked fine.

See if that works for you!

:) Nancy



来源:https://stackoverflow.com/questions/31395466/facebook-page-plugin-appears-as-link-only-on-website

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!