hello dears
is their any article on back to previous url velo code please
You wrote ânot workingâ in the title - what have you tried?
a lot of codes such as
import wixLocation from âwix-locationâ;
$w.onReady(function () {
// Event handler for button click
$w(â#button43â).onClick(() => {
// Navigate back to the previous URL
wixLocation.back();
});
});
Makes sense this wouldnât work
Thereâs no such thing
You canât really guess your way into making things work, read the documentation
https://dev.wix.com/docs/velo/api-reference/wix-location-frontend/introduction
As for implementing a back button, Iâd have two values saved in session storage - previousPage and currentPage
Whenever a page loads, it checks if currentPage is different than itself, and if so, sets previousPage to currentPage, and currentPage to the page being loaded
Then, you could simple have wixLocation send you to whatâs saved in previousPage
Note it will not work the same as a browserâs back button, since after going back, currentPage will become the previous page, and previousPage will become the current, resulting it another back button sending you back and forth between those two pages, rather than heading back through your tabâs history
can you please share a code with me please
Always search the forum first for similar questions before posting your own.