> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# Method name:

siteLocation.to(url: string, options: NavOptions)

# Method Link:

https://dev.wix.com/docs/sdk/frontend-modules/location/to.md

# Method Description:

Directs the browser to navigate to the specified URL.

The `to()` method navigates the browser to another web page.

 The `to()` method can only be used when browser
 [rendering](https://dev.wix.com/docs/develop-websites/articles/coding-with-velo/frontend-code/page-rendering/about-page-rendering.md) happens,
 meaning you can only use it in frontend code after the page is ready.

 The following link patterns are supported:

 + `/localPageURL`: Another page on a site.
 + `/localPageURL#`: Another page on a site scrolled to the
    element with the specified ID. The element must be an element that supports
    the `scrollTo` method.
 + `/localPageURL?queryParam=value`: Another page on a site with query parameters.
 + `/`: A site's home page.
 + `http(s)://`: An external web address.
 + `wix:document://`: A document stored in the Media Manager.
 + `mailto:@?subject=`: An email.
 + `tel:`: A phone number.


 To find the local URL of a page on a site in the editor:

 + Regular page: See the **SEO** tab of the **Page Settings** panel.
 + Dynamic page: See the **Page Info** tab of the **Page Settings** panel
   for the URL structure. The actual URL used for navigation needs to contain
   values where the placeholders are.

   For example, if the URL structure of a dynamic page looks like:

   ![Dynamic Page URL](https://wixmp-833713b177cebf373f611808.wixmp.com/images/velo-images/media_dynamic_url.png "Dynamic Page URL")

   and you have an item with the title "Waffles", the local URL to that page
   is /Recipes/Waffles.
 + Router page: You can't navigate directly to a specific router page. You
   can navigate to a URL with the router's prefix and the router code
   decides which page to route to.

 By default, when navigating to a new URL for a Wix page, the page scrolls to the top. Set
 the `disableScrollToTop` navigation parameter property to `true` if you want the
 page to remain at the current Y-axis position as the previously-viewed page.

 The `to()` method attempts to properly encode the URL parameter that
 is passed to it. For example, `.../some page` is encoded to
 `.../some%20page`. However, some URLs don't have 1 unambiguous encoding.
 In those cases it's up to you to encode the URL to reflect your intentions.
 Because of these situations, it's a best practice to always encode URLs
 before you pass them to the `to()` method.

 Note that Wix URLs don't contain spaces. A page which has spaces in its
 name has its spaces replaced with dashes (`-`). Similarly, a dynamic page
 whose URL contains the value of a field in a collection with spaces
 has its spaces replaced with dashes (`-`).

 > **Note:** The `to()` method doesn't work while previewing a site.

# Method Permissions:



# Method Permissions Scopes IDs:

undefined



# Method Code Examples:

## Navigate to a local link

```javascript
import { location } from '@wix/site-location';

// ...

location.to("/about-me");
```

## Navigate to a local link, without automatically scrolling to the top

```javascript
import { location } from '@wix/site-location';

// ...

const options = {
  disableScrollToTop: true
};

location.to("/about-me", options);
```

## Navigate to a local link and scroll to an element

```javascript
import { location } from '@wix/site-location';

// ...

location.to("/long-page#downUnder");

```

## Navigate to an external web link

```javascript
import { location } from '@wix/site-location';

// ...

location.to("http://wix.com");
```

## Open a new email window

```javascript
import { location } from '@wix/site-location';

// ...

location.to("mailto:a@b.com?subject=Something%20Intersting");
```

## Open a document

```javascript
import { location } from '@wix/site-location';

// ...

location.to("wix:document://v1/9bec_52fb06ea/filename.xls");
```

## Make a phone call

```javascript
import { location } from '@wix/site-location';

// ...

location.to("tel:+1-555-555-5555");
```