HashChangeEvent
Overview
HashChangeEvent is a class in Aspose.Html FOSS for Python.
Inherits from: Event.
Same-document fragment navigation event.
This class provides 5 methods for working with HashChangeEvent objects in Python programs.
Available methods include: __init__, init_event, prevent_default, stop_immediate_propagation, stop_propagation.
All public members are accessible to any Python application after installing the Aspose.Html FOSS for Python package.
Properties: bubbles, cancelable, current_target, default_prevented, event_phase, new_url, and 4 more.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
old_url | str | Read | Absolute URL string before the fragment transition. |
new_url | str | Read | Absolute URL string after the fragment transition. |
type | str | Read | The event type string. |
bubbles | bool | Read | Whether the event bubbles. |
cancelable | bool | Read | Whether the default action can be prevented. |
target | "EventTarget | None" | Read | The EventTarget on which the event was dispatched. |
current_target | "EventTarget | None" | Read | The EventTarget whose listener is currently being invoked. |
event_phase | int | Read | Phase constant: NONE (0), CAPTURING_PHASE (1), AT_TARGET (2), BUBBLING_PHASE (3). |
default_prevented | bool | Read | Whether preventDefault() was called on a cancelable event. |
timestamp | float | Read | Unix epoch time (seconds) at Event creation. |
Methods
| Signature | Description |
|---|---|
__init__(type: str, old_url: str, new_url: str) | Calls init(type, old_url, new_url) on this HashChangeEvent instance. |
prevent_default() | Set default_prevented to True if the event is cancelable. |
stop_propagation() | Stop event propagation after all listeners on the current target finish. |
stop_immediate_propagation() | Stop propagation AND prevent remaining listeners on the current target. |
init_event(type: str, bubbles: bool, cancelable: bool) | Legacy alias for pre-dispatch event initialization. |