我一直在尝试将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"]
}
]
}
基本上是一个瞬间我得到一个左边的聊天框架,但没有朋友加载它,谢谢你的支持。