search

Home  >  Q&A  >  body text

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?

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?

PHP中文网PHP中文网2810 days ago587

reply all(4)I'll reply

  • phpcn_u1582

    phpcn_u15822017-05-15 17:00:32

    It doesn’t matter if it is used here angular
    原理是把页面分为不同 directive,一开始虽然没有具体内容,但 directive 起到了占位符的作用,所以能看到页面框架。
    directive本身再通过 ajax ,向后台请求具体内容片断,填充进页面框架里,显示具体文本、图片。
    只要理解了原理,要实现这个效果本身很简单,最后用不用 angular

    reply
    0
  • ringa_lee

    ringa_lee2017-05-15 17:00:32

    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

    reply
    0
  • ringa_lee

    ringa_lee2017-05-15 17:00:32

    I think putting the js file under the body will have this effect

    reply
    0
  • 淡淡烟草味

    淡淡烟草味2017-05-15 17:00:32

    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(){

      当页面骨架显示完整后,这里再发起ajax请求,载入数据

    }

    reply
    0
  • Cancelreply