function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
suri03081988suri03081988 

How to get the previous page URL in JS controller

Hi All,

We are using AURA component with JS controller for the requirements.
I wante to to get the previous page URL in JS controller. After fetch the URL i have to take some search text on previous page URL.

Please give me some sample code to fetch the previous page URL.

Thanks in Advance
VinayVinay (Salesforce Developers) 
Hi Suri,

You can try using window.history.back();

https://codingwiththeforce.com/category/salesforce-development-tutorials/salesforce-development-lightning-web-components-lwc/

Thanks,