Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. TaskPriorityChangeEvent

TaskPriorityChangeEvent

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Note: This feature is available inWeb Workers.

TheTaskPriorityChangeEvent is the interface for theprioritychange event.

Event TaskPriorityChangeEvent

Constructor

TaskPriorityChangeEvent()

Creates a newTaskPriorityChangeEvent object, setting an event name and previous priority.

Instance properties

This interface also inherits the properties of its parent,Event.

TaskPriorityChangeEvent.previousPriorityRead only

Returns thepriority of the correspondingTaskSignalbefore thisprioritychange event.

Instance methods

This interface has no methods of its own, but inherits the methods of its parent,Event.

Examples

An object of this type is returned in the handler for aprioritychange event.The code below shows a handler in which thenewPriority andpreviousPriority are logged.

js
// Listen for 'prioritychange' events on the controller's signal.controller.signal.addEventListener("prioritychange", (event) => {  const previousPriority = event.previousPriority;  const newPriority = event.target.priority;  console.log(`Priority changed from ${previousPriority} to ${newPriority}.`);});

A more complete live example can be found inprioritychange event > Examples.

Specifications

Specification
Prioritized Task Scheduling
# sec-task-priority-change-event

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2026 Movatter.jp