javascript - Tmall homepage first screen data source
曾经蜡笔没有小新
曾经蜡笔没有小新 2017-07-05 10:48:27
0
7
995

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

曾经蜡笔没有小新
曾经蜡笔没有小新

reply all(7)
巴扎黑

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.

淡淡烟草味

Alibaba uses fetch technology to load, not ajax.

伊谢尔伦

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

仅有的幸福

Template engine
Variable replacement

小葫芦

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

女神的闺蜜爱上我

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

学霸

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.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template