开发者

Limit of JQuery's append()

开发者 https://www.devze.com 2023-01-18 02:22 出处:网络
My database contains huge records. I wants to use twitter like pagination with the help of JQuery\'s append().

My database contains huge records. I wants to use twitter like pagination with the help of JQuery's append().

Is any limit available for JQuery's ap开发者_高级运维pend()?


There's one limit which isn't really of concern here, if the string's over 512 bytes then the dom fragments created by it aren't cached, but it seems you're more concerned with an upper-bound of content in general.

In that case, it's really whatever the limit of .innerHTML in the browser is (pretty damn high), though when appending lots of content you may get some extreme lag in older browsers especially.


There's a small chance you need to worry about maximum append limits (see Nick's answer). Speed is a larger concern.

I once asked a question about speed of adding elements and eventually tested it myself. See this topic for speed tests. As you can see, .innerHTML is much faster than .append().

0

精彩评论

暂无评论...
验证码 换一张
取 消