简体   繁体   English

Facebook Connect Javascript SDK突然无法在Chrome和Firefox中加载

[英]Facebook Connect Javascript SDK Suddenly Not Loading in Chrome and Firefox

Problem Solved, See Answer Below 问题已解决,请参见下面的答案

I have a site that has been operating for a couple of weeks using Facebook Authentication (www.myappwill.com). 我有一个使用Facebook身份验证(www.myappwill.com)运作了几个星期的网站。 Everything has been fine until today, suddenly none of the Facebook functionality is working in Chrome or FireFox. 到今天为止一切都很好,突然之间所有Facebook功能都无法在Chrome或FireFox中使用。 Nothing has changed with the code or with the Facebook app configuration. 代码或Facebook应用程序配置没有任何变化。 Curiously, everything is FINE IN MICROSOFT EDGE!?! 奇怪的是,一切都很好。

Specifically, I am getting this error in the browser: 具体来说,我在浏览器中收到此错误:

GET https://connect.facebook.net/en_US/sdk.js net::ERR_NAME_NOT_RESOLVED

I searched Stackoverflow and found several similar questions to this and all recommended that you explicitly include the HTTP protocol in front of the FB JavaScript SDK URL. 我搜索了Stackoverflow,发现了与此类似的几个问题,所有这些都建议您在FB JavaScript SDK URL前面明确包含HTTP协议。 I tried adding "https:" and it worked. 我尝试添加“ https:”,它起作用了。 . .for about 30 minutes. 约30分钟。 Now it is back to not working again and I am at a loss. 现在又回到了无法正常工作的状态,我很茫然。

We are hosting on Azure if that is another clue. 如果这是另一个线索,我们将托管在Azure上。 This site is in production and we are getting support emails now so your help is appreciated. 该站点正在生产中,我们现在正在获取支持电子邮件,因此感谢您的帮助。

After consulting with a few folks and digging around a bit I have discovered that there is nothing wrong at all with the code. 在咨询了一些人并深入研究之后,我发现代码完全没有错。

This is a DNS issue . 这是DNS问题 I assume that some of the Facebook server IP addresses changed and that was causing the requests for their JavaScript SDK to fail. 我假设某些Facebook服务器IP地址已更改,这导致对其JavaScript SDK的请求失败。

I realized this after attempting to connect on devices and networks that had not previously connected to the site. 在尝试连接之前未连接到站点的设备和网络后,我意识到了这一点。

The Fix: 解决方法:

Simply flush your DNS cache. 只需刷新您的DNS缓存。 If you are using Windows, just go to a command prompt and type ipconfig /flushdns . 如果使用Windows,则只需转到命令提示符并键入ipconfig /flushdns

We also needed to flush the DNS on the firewall here in our office. 我们还需要在我们办公室的防火墙上刷新DNS。 The bottom line: there may not be a problem with your code. 最重要的是:您的代码可能没有问题。

Hope this spares someone the panic I just went through! 希望这可以避免我刚经历的恐慌!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM