2015-10-04 82 views
3

我想使用jQuery的客戶端加載LinkedIn使用此代碼的個人資料頁:jQuery的Ajax請求HTML頁面

$.get("https://dz.linkedin.com/pub/arezki-lebdiri/75/a51/4b5", function(data) { 
     $(".result").html(data); 
     alert("Load was performed."); 
    }); 

和我得到這個錯誤:

的XMLHttpRequest無法加載 https://dz.linkedin.com/pub/arezki-lebdiri/75/a51/4b5。否 「訪問控制 - 允許來源」標題出現在請求的 資源中。因此不允許原產地'null'訪問。

所以任何幫助,請在browsr改變「訪問控制允許來源」

+0

「訪問請求任何網站與阿賈克斯-Control-Allow-Origin「必須出現在您請求的頁面上。由於請求的頁面在LinkedIn上,因此您無法更改Access-Control-Allow-Origin。也許,這[link](http://stackoverflow.com/questions/6866912/load-linkedin-member-profile-by-inserting-javascript-with-jquery)可以幫助你 –

+0

也許這有助於:http:// stackoverflow .com/questions/20035101/no-access-control-allow-origin-header-is-present-on-the-requested-resources –

+1

你應該使用iframe來顯示頁面配置文件但是linkedin已經不允許它。那麼你仍然可以將它放在服務器端,但這將再次是linkedin服務條款。唯一可行的解​​決方案是使用他們的API –

回答