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')
Parameters
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:
- the render pass was aborted
- the server sends an error status
- there is a network issue
- targets could not be matched
See Render lifecycle hooks for more information about handling errors, or running code after rendering.
Type: up.RenderJob