我尝试在浏览器中执行以下代码时失败:
var req = new XMLHttpRequest();
req.open('GET', "https://www.facebook.com/dialog/oauth?client_id=464891386855067&redirect_uri=https://www.facebook.com/connect/login_success.html&scope=basic_info,email,public_profile,user_about_me,user_activities,user_birthday,user_education_history,user_friends,user_interests,user_likes,user_location,user_photos,user_relationship_details&response_type=token", false);
req.send();
var responseURL = req.responseURL;
console.log(responseURL);
我收到以下错误:
未捕获的网络错误:无法在“XMLHttpRequest”上执行“发送”:无法加载“https://www.facebook.com/dialog/oauth?client_id=464891386855067&redirect_uri=https://www.facebook.com/connect/login_success.html&scope=basic_info,email,public_profile,user_about_me,user_activities,user_birthday,user_education_history,user_friends,user_interests,user_likes,user_location,user_photos,user_relationship_details&response_type=token”。
关于这里出了什么问题的任何想法?我很确定代码会起作用。