I am looking to add a button to a page that will refresh the page when pressed (essentially, the CTRL+R function). Can this be accomplished using Corvid?
top of page
Important forum update
This forum is migrating to one unified Wix community forum starting July 26th, and will be read-only during the process.
![feature fixed.png](https://static.wixstatic.com/media/3bfa8a_f845e1016b8a49758acdd6edd6610c3b~mv2.png/v1/crop/x_0,y_2,w_852,h_508/fill/w_104,h_62,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/feature%20fixed.png)
Wishlist Page is the official platform for requesting new features. You can vote, comment, and track the status of the requested features.
bottom of page
You need to add at least your page onReady to that code, hence why brainstorrrm adding the ...
import wixLocation from 'wix-location'; $w.onReady(function () { $w("#myButton").onClick( (event) => { wixLocation.to(wixLocation.url); // refresh current page } );
How did you managed to make it work ? I've tried that code, but doesn't work
Thank you both! This was very helpful.
I've added the following to the page code with no success :-( import wixLocation from 'wix-location'; $w("#button109").onClick( (event) => { wixLocation.to(wixLocation.url); // refresh current page } );
There are no errors (i.e., red dots) displaying on any line.
@brainstorrrm, do you see anything wrong with the way I've adapted it or does the refresh capability just not exist thru Corvid?
import wixLocation from 'wix-location'; ... $w("#myButton").onClick( (event) => { wixLocation.to(wixLocation.url); // refresh current page } );
https://www.wix.com/corvid/reference/wix-location.html
https://www.wix.com/corvid/reference/$w.Button.html