Edit this page

up.fragment up.navigate([target], [options])
JavaScript function

Navigates to the given URL by updating a major fragment in the current page.

up.navigate() will mimic a click on a vanilla <a href> link to satisfy user expectations regarding scrolling, focus, request cancellation and many other side effects. To update a fragment without side effects, use up.render().

Instead of calling up.navigate() you may also call up.render({ navigate: true }).


Parameters

[target]
optional

The target selector to update.

If omitted a main target will be rendered.

You can also pass a DOM element or jQuery element here, in which case a selector will be derived from the element attributes. The given element will also be set as the { origin } option.

Instead of passing the target as the first argument, you may also pass it as { target } option.

[options.url]
optional

The URL to navigate to.

string
[options]
optional

See options for up.render().


Return value

A promise that fulfills with an up.RenderResult once the page has been updated.

The promise rejects when one of the following conditions occur:

See Render lifecycle hooks for more information about handling errors, or running code after rendering.