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

Fetches the given URL with JavaScript and replaces the current layer's main fragment 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.

Type: string

Render options

[options]
optional

Additional render options to use for rendering the destination URL.

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

Type: Object

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.

Type: up.RenderJob