Edit this page

up.fragment up.visit(url, [options])
JavaScript function

Fetches this given URL with JavaScript and replaces the current layer's main element with a matching fragment from the server response.

Example

This would replace the current page with the response for /users:

up.visit('/users')

Destination

url
required

The URL to visit.

string

Render options

[options]
optional

Additional render options to use for rendering the destination URL.

Most options for up.render() may be used.

[options.navigate=true]
optional

Whether to apply navigation defaults, such as scrolling and updating history.

boolean

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.