Skip to main content
D S (Student) perguntou em #LWC

Hi,

I am trying to reload the previous page after saving an edit form. After clicking on Save, I have used  window.history.back(); but it only navigates to the previous page, I require it to reload as well. Is there a way to do this?

#LWC  #LWC Component #Custom LWC #LWC Development #LWC Components

4 respostas
  1. 10 de dez. de 2024, 07:23

    Hii,

    To navigate back and reload the previous page, the most straightforward solution is to use window.history.back() followed by a short delay and window.location.reload().

     

    The implementation may look something like this : 

    window.history.back();

    setTimeout(function() {

    window.location.reload();

    }, 500);

0/9000