StorageEvent: phương thức initStorageEvent()

Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

Phương thức StorageEvent.initStorageEvent() được dùng để khởi tạo giá trị của một StorageEvent.

Cú pháp

js
initStorageEvent(type)
initStorageEvent(type, canBubble)
initStorageEvent(type, canBubble, cancelable)
initStorageEvent(type, canBubble, cancelable, key)
initStorageEvent(type, canBubble, cancelable, key, oldValue)
initStorageEvent(type, canBubble, cancelable, key, oldValue, newValue)
initStorageEvent(type, canBubble, cancelable, key, oldValue, newValue, url)
initStorageEvent(type, canBubble, cancelable, key, oldValue, newValue, url, storageArea)

Tham số

typeArg

Tên của sự kiện.

canBubble Optional

Một giá trị boolean cho biết sự kiện có nổi lên qua DOM hay không.

cancelable Optional

Một giá trị boolean cho biết sự kiện có thể bị hủy hay không.

key Optional

Khóa mà giá trị của nó đang thay đổi do sự kiện này.

oldValue Optional

Giá trị cũ của khóa.

newValue Optional

Giá trị mới của khóa.

url Optional

URL của tài liệu khởi tạo thay đổi.

storageArea Optional

Đối tượng Storage đại diện cho vùng lưu trữ mà sự kiện này xảy ra trên đó.

Giá trị trả về

Không có (undefined).

Thông số kỹ thuật

Thông số kỹ thuật
HTML
# dom-storageevent-initstorageevent

Tương thích trình duyệt

Xem thêm