search

Home  >  Q&A  >  body text

javascript - Tmall homepage first screen data source

I am studying the code of Tmall homepage, and I feel that its first-screen data does not look like it is loaded by ajax, so I would like to ask, how is its first-screen data loaded?

for example:

window.g_config.serverTime = 1496370628991;   // "1496370628991"这个数字每次刷新都是变化的
<p id="J_defaultData" style="display:none;"> ………… </p> // 这个p(p中的json数据太长,所以省略了)里面的数据查看源代码的时候就有,并不像是ajax请求的。

The picture below is the data in p

曾经蜡笔没有小新曾经蜡笔没有小新2760 days ago1034

reply all(7)I'll reply

  • 巴扎黑

    巴扎黑2017-07-05 10:50:27

    After studying for an afternoon, I probably understand that the Tmall homepage is made using node on the server side, so the data will be brought in when the HTML is rendered. What you said above is correct. The data you get when you check the source code must be coming directly from the server.

    reply
    0
  • 淡淡烟草味

    淡淡烟草味2017-07-05 10:50:27

    Alibaba uses fetch technology to load, not ajax.

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-07-05 10:50:27

    I haven’t researched it, but I guess it comes directly from the server

    reply
    0
  • 仅有的幸福

    仅有的幸福2017-07-05 10:50:27

    Template engine
    Variable replacement

    reply
    0
  • 高洛峰

    高洛峰2017-07-05 10:50:27

    You can take a look at things related to server-side rendering. . In order to improve the rendering speed of the first screen. . Whether you use PHP or nodeJS, it can be rendered on the server side

    reply
    0
  • 女神的闺蜜爱上我

    女神的闺蜜爱上我2017-07-05 10:50:27

    https://developer.mozilla.org... fetch的API

    reply
    0
  • 欧阳克

    欧阳克2017-07-05 10:50:27

    I object to the fetch mentioned above, whether it is fetch or ajax. You can see the request being sent in the network, but obviously not on the home page.

    reply
    0
  • Cancelreply