(Vegvisir 2, Vegvisir 3)
Navigation.navigate()
Perform a soft-navigation on an element.
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.
Passing nothing to this parameter will target the top shell. This would be equivalent to clicking a link.
= Snippet::put("docs/API/JS/Navigation/navigate/0", Snippet::JAVASCRIPT) ?>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.
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.
= Snippet::put("docs/API/JS/Navigation/navigate/2", Snippet::JAVASCRIPT) ?>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.
This method will not return anything, but a navigation in progress can be aborted with Navigation.abort
.
Programmatically invoke a top navigation - as if a user clicked a link.
= Snippet::put("docs/API/JS/Navigation/navigate/0", Snippet::JAVASCRIPT) ?>An example how a simple "click to refresh" button can be implemented.
= Snippet::put("docs/API/JS/Navigation/navigate/example-0-0", Snippet::JAVASCRIPT) ?>