Advertisement
Guest User

Untitled

a guest
Nov 17th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. @Samrat Shrestha This snipped work for you
  2.  
  3. <doctype html>
  4. <html>
  5. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js">
  6. </script>
  7. <head>
  8. <script type="text/javascript">
  9. $(document).ready(function() {
  10. console.log("Time until DOMready: ",window.performance.timing.loadEventEnd-window.performance.timing.navigationStart);
  11. });
  12. </script>
  13. <!-- do all the stuff you need to do -->
  14. </head>
  15. <body>
  16.  
  17. </body>
  18. </html>
  19.  
  20.  
  21. The ready event occurs after the HTML document has been loaded,
  22. you not able to get page loading end time during window.onload (page loading).
  23.  
  24. https://stackoverflow.com/questions/3698200/window-onload-vs-document-ready
  25. https://developer.mozilla.org/en-US/docs/Web/API/Navigation_timing_API#Examples
  26. https://developer.mozilla.org/en-US/docs/Web/API/PerformanceTiming/loadEventEnd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement