(Vegvisir 2, Vegvisir 3)

Navigation.navigate()

Perform a soft-navigation on an element.

Description

Parameters

target

An optional instance of an HTMLElement which will be the target of this navigation.

Vegivisr.rootShellElement will be used if no argument is passed to this parameter.

Examples

Passing nothing to this parameter will target the top shell. This would be equivalent to clicking a link.

Passing an HTMLElement to this parameter would in this example with no other arguments changed, replace the innerHTML of the target element with the response from /some-page.

position

This parameter takes an optional Navigation.POSITION string which can be used to change where content from the destination URL should be placed relative to the target element.

Examples

Passing nothing to this parameter will replace the innerHTML of target.

Passing an position string will in this example place the contents afterEnd from target.

mode

This parameter takes an optional Navigation.MODE string which can be used to change how the contents of the destination URL should be placed relative to existing content around the target element.

Return values

This method will not return anything, but a navigation in progress can be aborted with Navigation.abort.

Examples

Basic usage

Programmatically invoke a top navigation - as if a user clicked a link.

Click to refresh

An example how a simple "click to refresh" button can be implemented.