Home > Backend Development > PHP Tutorial > js-About a discuz lazy loading issue

js-About a discuz lazy loading issue

WBOY
Release: 2016-10-09 08:31:55
Original
1408 people have browsed it

jsphpjquery

Recently I built a website using the discuz program, but I’m not familiar with lazy loading, JQ, and js, so I’m here to ask some experts.

The website page is pieced together through the interface that comes with dicuz
The internal calling code is as follows

<code> <div class="1"><!--{block/552}--></div><div class="2"><!--{block/552}--></div></code>
Copy after login

The external calling code is roughly as follows

<code> <div class="1"><script type="text/javascript" src="xxxx/api.php?mod=js&bid=1"></script></div><div class="2"><script type="text/javascript" src="xxxx/api.php?mod=js&bid=2"></script></div></code>
Copy after login

The problem now is that the calling method is like this. If you call it several times in a page, then visit Measuring a large database will be extremely slow. Then I would like to ask how to write lazy loading code, such as scrolling the browser to a certain position and then triggering the query. Minimize burst requests to the server. Baidu has not found this kind of lazy loading example for a long time! Thank you, great gods!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template