我一直在嘗試將facebook聊天加載到我的正常Facebook頁面一側的框架中,以便讓我更容易聯繫我的朋友,我嘗試了不同的方式方法與jquery等,如ajaxing的內容並將其加載到div等,但由於某種原因,朋友列表不會像彈出式聊天本身一樣加載。這裏是我的代碼,也許有人可以幫助:在iframe中加載facebook彈出式聊天.. Chrome擴展程序
main.js
$(window).load(function() {
$('body').append('<iframe id="heyhey" src="presence/popout.php?lite=true"></iframe>');
$.ajax({
url: "/presence/popout.php",
cache: false,
success: function(html){
$('#heyhey').contents().find('html').html(html);
}
});
});
的main.css
#heyhey{ position:absolute;top:20px;left:1px;height:100%;width:222px;}
和我的清單:
{
"name": "facebookchat sample",
"description": "testing out fb chat",
"version": "1.0",
"content_scripts": [
{
"matches": ["http://*.facebook.com/*"],
"css": ["main.css"],
"js": ["jquery-1.6.2.min.js", "main.js"]
}
]
}
基本上是一個瞬間我得到一個左邊的聊天框架,但沒有朋友加載它,謝謝你的支持。