我正在學習JavaScript,因此我計劃做一個Chrome擴展。我正在製作年齡計算器。我開發了一些代碼。我堅持如何在外部JavaScript文件中使用jQuery?如何將jQuery添加到構建Chrome擴展的外部JavaScript文件?
if (ageYears > 0) {
document.write(ageYears +" year");
if (ageYears > 1) document.write("s");
if ((ageMonths > 0)||(ageDays > 0)) document.write(", ");
}
if (ageMonths > 0) {
document.write(ageMonths +" month");
if (ageMonths > 1) document.write("s");
if (ageDays > 0) document.write(", ");
}
if (ageDays > 0) {
document.write(ageDays +" day");
if (ageDays > 1) document.write("s");
}
的manifest.json
{
"name": "Age Calculator",
"description": "This application gives you a calculation of how old are you today, since the day you were born.",
"version": "0.1",
"manifest_version": 2,
"app": {
"background": {
"scripts": ["background.js"]
}
},
"icons": { "128": "calendar-128.png" }
"author" : "Miral Kumbhani"
}
該文件的主文件你可以發送你的清單嗎? – Manav
https://stackoverflow.com/questions/21317476/how-to-use-jquery-in-chrome-extension – TKoL
請保留您的問題到每個問題一個問題。包含多個非緊密相關問題的問題被認爲是過於寬泛並且往往會被封閉。其原因是堆棧溢出格式旨在提供對將來人們有用的問題和答案的基礎,而不僅僅是當前詢問的人。有多個問題的問題往往過於具體,對於其他尋求幫助解決問題的人有用。通常,要解決更大的問題,有必要結合多個問題的答案。 – Makyen