1 Like
if you have a dataset on your page you can call save() then call location.to to navigate to the page.
To make sure the item is ready before you navigate use the following method:
$w("#myDataset").save()
.then( (item) => {
wixLocation.to("/somepage");
} )
.catch( (err) => { let errMsg = err;
} );
Try that code (worked fine for me)
import wixLocation from âwix-locationâ;
import wixWindow from âwix-windowâ;
$w.onReady( function () {
$w(â#registerNowâ).onClick( function () {
wixLocation.to(wixLocation.url);
wixWindow.lightbox.close(âlightbox1â);
})
})
To anyone looking to reload a page onSubmit, onClick, the following code worked for me:
import wixLocation from âwix-locationâ ;
$w . onReady ( function () {
$w ( â#button390â ). onClick ( ( event ) => {
wixLocation . to ( wixLocation . url ); // refresh current page
});
});