Front-end - Some web pages will display a web page frame when they are first opened, and the content will be displayed after a while. What technology is used for such web pages?
PHP中文网2017-05-15 16:58:32
0
4
566
For example: http://www.weather.com/ When you first open it, it looks like this:
The specific content will then be displayed. Please tell me, what technology is used for such a web page?
It doesn’t matter if it is used here angular 原理是把页面分为不同 directive,一开始虽然没有具体内容,但 directive 起到了占位符的作用,所以能看到页面框架。 directive本身再通过 ajax ,向后台请求具体内容片断,填充进页面框架里,显示具体文本、图片。 只要理解了原理,要实现这个效果本身很简单,最后用不用 angular
There should be nothing surprising, because during the loading process of this website, the background image has not been loaded when the html and css are loaded. After a while, the background image is loaded and the effect of the entire website is displayed. Take a look at the network of f12. Got it This is the first one to load
This is the last picture that has been loaded
My internet speed is a bit slow and it takes 1.15 seconds to load the background image
It doesn’t matter if it is used here
angular
原理是把页面分为不同
directive
,一开始虽然没有具体内容,但directive
起到了占位符的作用,所以能看到页面框架。directive
本身再通过ajax
,向后台请求具体内容片断,填充进页面框架里,显示具体文本、图片。只要理解了原理,要实现这个效果本身很简单,最后用不用
angular
There should be nothing surprising, because during the loading process of this website, the background image has not been loaded when the html and css are loaded. After a while, the background image is loaded and the effect of the entire website is displayed. Take a look at the network of f12. Got it
This is the first one to load
This is the last picture that has been loaded
My internet speed is a bit slow and it takes 1.15 seconds to load the background image
I think putting the js file under the body will have this effect
Let me talk about my personal opinions, for reference only:
I think this effect can be achieved through ajax.
First make the skeleton with html+css
Then js:
window.onload=function(){
}