开发者

At what point in the render process of a web page can we interact with that page

开发者 https://www.devze.com 2022-12-26 16:22 出处:网络
I\'d like to measure to distinct user experience points during the rendering of an HTML page: Point which user sees the first painting of the page

I'd like to measure to distinct user experience points during the rendering of an HTML page:

  1. Point which user sees the first painting of the page
  2. Point at which user can interact with the page - meaning sees 75% of it or can actually register a button click or link click

I am pretty certain these UX interactions can start before the HTML code is fully rendered, so would that instance be the JS func "OnLoad" or some other distinct measur开发者_JAVA技巧eable value/function?

If it helps, we can even narrow the answer down to WebKit based browsers.


OnLoad is a tricky thing to implement. I would suggest using a prepackaged solution like jQuerys $(document).ready(function(){}) in order to maintain cross browser compatibility.


Not sure if this is what you're looking for, but if you just want to know when the DOM tree is loaded (which strikes me as a decent approximation of 'when we can interact with the page'), you could try the JavaScript event DOMContentReady / 'domReady'.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号