'tippy.js tool tips stop working after "window.reload()"

I have a function to reload my cart.

function reloadPage() { window.location.reload(); }

When triggered tippy.js tool tips stops working. I have tried to reinitiate tippy in the function but nothing seems to work. I have also tried to set localStorage before reload so I can set an if statement to reinitiate but was not able to get this working either.


Is it possible to initiate tippy or anything for that matter ~ (simple alert) if a window reload is called?

This was my faild attempt at using local storage within this function.

function reloadPage() {
  window.localStorage.setItem('tippyRefresh','true');
  window.location.reload();
}
    
$(document).ready(function() {
  if (localStorage.getItem('tippyRefresh') == 'true') {
        alert("Hello world");
    }
});


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source