javascript to refresh a page automatically code example Example 1: javascript reload page location.reload(); Example 2: refresh page js window.location.reload(true);