Skip to main content
D S (Student) 님이 #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개
  1. 2024년 12월 10일 오전 7: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