how to run a function on page reload js code example Example: javascript reload page location.reload();