KScript docs
EN

Components

In-page navigation

Add live-navigate to a same-site link to fetch the destination page and replace the document body in place. Back and Forward restore the page and its scroll location. Links keep their ordinary behavior for modified clicks, downloads, other origins, and page policies that require a new document.

HTML page
<a href="/notes" live-navigate>Notes</a>

The browser dispatches kscript:navigating before an in-page visit and kscript:navigated after it. Call preventDefault() on the first event to cancel the visit. Body scripts run on subsequent visits unless marked live-navigate-once. Optional JavaScript can also call KScriptLive.navigate('/notes').