FB is not defined in Facebook Login
问题 I have the following code but the FB.login gives a FB is not defined javascript error. What am I missing? <html> <body> <div id="fb-root"></div> <script> window.fbAsyncInit = function() { FB.init ({ appId : 'XXXX', status : true, cookie : true, xfbml : true }); }; (function() { var e = document.createElement('script'); e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js'; e.async = true; document.getElementById('fb-root').appendChild(e); }()); FB.login(function(response)