語法
在諸如 addEventListener() 之類的方法中使用事件名稱,或設定事件處理程式屬性。
js
addEventListener("appinstalled", (event) => { })
onappinstalled = (event) => { }
事件型別
一個通用的 Event。
示例
您可以使用 appinstalled 事件在 addEventListener 方法中監聽
js
window.addEventListener("appinstalled", () => {
console.log("Thank you for installing our app!");
});
或者使用 onappinstalled 事件處理程式屬性
js
window.onappinstalled = () => {
console.log("Thank you for installing our app!");
};
規範
| 規範 |
|---|
| 清單孵化 # dom-window-onappinstalled |
瀏覽器相容性
載入中…