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

js-About a discuz lazy loading issue

WBOY
WBOYOriginal
2016-10-09 08:31:551353browse

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>

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>

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!

Statement:
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