periksa apakah halaman dimuat atau tidak javascript

if (document.readyState === 'complete') {
  // The page is fully loaded
}
Anthony Smith