我写了谷歌延伸版,它操纵了本页(实际上增加了一个纽子)。
In my content script, I want to load the Facebook Graph API:
$fbDiv = $(document.createElement( div )).attr( id , fb-root );
$fbScript = $(document.createElement( script )).attr( src , https://connect.facebook.net/en_US/all.js );
$(body).append($fbDiv);
$(body).append($fbScript);
console.log("fbScript: " + typeof $fbScript.get(0));
console.log("fbScript parent: " + typeof $fbScript.parent().get(0));
console.log("find through body: " + typeof $(body).find($fbScript.get(0)).get(0));
However, the script doesn t seem to added to body
. Here s the console log:
fbScript: object
fbScript parent: undefined
find through body: undefined
任何关于我做什么错误的想法?