TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Lazy Loading Asyncronous Javascript

28 pointsby philfreoalmost 15 years ago

1 comment

amixalmost 15 years ago
Another solution might be to set the sourcing of JavaScript in a timeout, e.g. setTimeout(_sourceJavascript, 300). I think this will bypass the blocking nature. This is only based on my intuition thought - it isn't tested.<p>--<p>It's also important to note that window.onload will only fire when everything is loaded (including scripts and large images). To bypass this problem you should use something like jQuery.ready(document) or Dean Edwards onload hack ( <a href="http://dean.edwards.name/weblog/2005/09/busted/" rel="nofollow">http://dean.edwards.name/weblog/2005/09/busted/</a> ).
评论 #1379823 未加载
评论 #1377532 未加载