2012-10-19 67 views
2

我們正在與Linked IN集成以提取用戶配置文件。它的工作正常,但我們注意到在一些Windows 7/IE 9機器上,Linked IN彈出窗口出現並且是空白的。我們在控制檯中看到下面的錯誤。LinkedIN集成JS API

消息:對象不支持屬性或方法 '替換' 行:861 字符:17 代碼:0 URI:http://platform.linkedin.com/js/framework?v=0.0.2000-RC1.21420-1403&lang=en_US

代碼段下面

<script type="text/javascript" src="https://platform.linkedin.com/in.js?async=false" > 
    api_key: tw6oqfav7ms1 
    authorize:false 
</script> 

//We have a custom image for linkedIN, onclick of the same below code is called. 
$("#mylinkedin").click(function() { 
    IN.UI.Authorize().params({"scope":["r_fullprofile", "r_emailaddress","r_contactinfo"]}).place(); 
    IN.Event.on(IN, "auth", onLinkedInAuth); 
}); 

function onLinkedInAuth() {  
    IN.API.Profile("me").fields([ "id","firstName", "location","lastName","skills","positions","educations","languages","phone-numbers","certifications","emailAddress","mainAddress"]).result(displayProfiles); 
    IN.User.logout(); //After we take the data, we do a log out 
    $.get("https://api.linkedin.com/uas/oauth/invalidateToken"); 
} 

function displayProfiles(profiles) { 
//Access profile and process 
member = profiles.values[0] 
........... 
} 
+0

嗨,你可以有任何想法我們如何得到實際的配置文件圖像,意味着沒有linkedin圖像.. – Pramod

回答

0

我避難所」 t有機會對此進行測試,但對我來說,看起來您已在代碼中引入競爭條件,特別是在onLinkedInAuth()中。

IN.API.Profile()的調用會調用對LinkedIn的異步調用,但在IN.User.logout()代碼中的JavaScript引擎時可能還未完成。

我的代碼更改爲以下,看看是否能解決問題:

IN.API.Profile("me") 
    .fields([ "id","firstName", "location","lastName","skills","positions","educations","languages","phone-numbers","certifications","emailAddress","mainAddress"]) 
    .result(function(profile) { 
    displayProfiles(profile); 
    IN.User.logout(); //After we take the data, we do a log out 
    $.get("https://api.linkedin.com/uas/oauth/invalidateToken"); 
    }); 
2

感謝您response.I能弄清楚我自己的問題。我們觀察到的是在IE9的Win7機器上,Linked IN授權彈出窗口是空白的。當我取消選中「啓用保護模式」時,彈出窗口即將出現,沒有任何問題。