Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 HTML 页面上使用预取/预渲染。
<link rel="prefetch" href="example.com" />
我想使用 JS 延迟这个动作。
Maybe try using setTimeout and document.write. Tested in chrome and it loads the site after 2s (saw in network panel)
window.setTimeout(function() { document.write("<link rel='prefetch' href='http://www.google.de' />") } ,2000 );