Newer Version Available

This content describes an older version of this product. View Latest

Navigate to a Web Page

The navigation service supports different kinds of pages in Lightning. Each page reference type supports a different set of attributes and state properties.

Instead of using force:navigateToURL, we recommend navigating to web pages using the lightning:navigate component with the standard__webPage page type.

This code shows examples of navigating to a web page using the old force:navigateToURL event.

Replace the previous code that uses force:navigateToURL with the following code. This example shows how to navigate to a web page using the standard__webPage page type. It assumes that you added <lightning:navigation aura:id="navigationService" /> in your component markup.