2013-10-15 80 views
2

使用Linkedin教程,我試圖用Javascript登錄LinkedIn。使用javascript問題驗證LinkedIn API api

我有問題:使用驗證螢火我意識到http請求不顯示錯誤,但LinkedIn的按鈕沒有渲染和HTTP響應是:

(function(){ 
var r=("true" === "false"), a=("false" === "false"), h=[], e=("false" === "true"); 
var p="${SCOPE_NAME}"; 
var s=("SCOPE_VALID" === "SCOPE_INVALID"), n=("SCOPE_VALID" === "SCOPE_NOT_AUTHORIZED"), 
d=("SCOPE_VALID" === "SCOPE_DISABLED"); 

if(e){ 
    throw new Error("An error occurred."); 
} 
else if (!a) { 
    throw new Error("API Key is invalid"); 
} 
else if (s) { 
    throw new Error("Scope parameter is invalid: " + p); 
} 
else if (n) { 
    throw new Error("Scope parameter is not authorized: " + p); 
} 
else if (d) { 
    throw new Error("Scope parameter is disabled: " + p); 
} 
else if (h.length == 0) { 
    throw new Error("You must specify a valid JavaScript API Domain as part of this key's 
configuration."); 
} 
else if (!r) { 
    throw new Error("JavaScript API Domain is restricted to "+h.join(", ")); 
} 

else { 
    throw new Error("Unknown Error"); 
} 
})(); 

你能幫助我解決這個問題?

回答