3
將jquery-ui(css和js)和jquery放入清單後,我可以使用jq選擇器($),但jquery-ui似乎無法訪問。例如,我想插入內容腳本可調整大小的DIV(content_script.js):Chrome擴展內容腳本中的JQueryUI
var $div = document.createElement('div');
$div.id = 'divId';
$div.innerHTML = 'inner html';
$("body").append($div);//works without error
$("#divId").css("background-color","yellow");//works
//doesn't give resizable handles, however works in a regular html file:
$("#divId").resizable();
//however this also has issue:
document.getElementById("divId").style.resize = "both";
清單:
"css":["jquery-ui.css"],
"js": ["jquery-ui.js","jquery.js","content_script.js"]