Home > Web Front-end > JS Tutorial > Problems in using Jquery append method

Problems in using Jquery append method

一个新手
Release: 2017-09-25 10:17:14
Original
2639 people have browsed it

Simple example:

<p style="margin-top: 5px;">//html<p class="answer"></p><br/></p>
Copy after login

Description:
Function: Slide down to load more, request data through ajax and insert the assembled html template into the list.
Implementation: Insert an html template into the .list through the

$(&#39;.list&#39;).append(&#39;_html&#39;);
Copy after login

method. However, after triggering the load more times, it is found that the append() method executes slower and slower.

Solution: After investigation, it was found that the .list class also exists in the _html template to be inserted. Therefore, after multiple insertions, execute $('.list').append( '_html');, $('.list') will take longer and longer.

The above is the detailed content of Problems in using Jquery append method. For more information, please follow other related articles on the PHP Chinese website!

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