6
我有一個彈出窗口調用RESTful後端來執行Oauth身份驗證,但是當返回結果時,它會在彈出窗口中顯示JSON而不是關閉彈出窗口並將JSON存儲在一個模型。我該如何解決?從彈出窗口獲取JSON結果。 Angular.JS
this.socialLogin = function(provider) {
var url = urlBase + '/' + provider,
width = 1000,
height = 650,
top = (window.outerHeight - height)/2,
left = (window.outerWidth - width)/2,
socialPopup = null;
$window.open(url, 'Social Login', 'width=' + width + ',height=' + height + ',scrollbars=0,top=' + top + ',left=' + left);
};
爲什麼你需要擺在首位額外的窗口?如果它在您的域上,您可以使用postMessage API將數據傳回主窗口 – charlietfl
當我嘗試時,根本沒有任何反應。 – Knoland
當你嘗試什麼? – charlietfl