Search

3/25/2009

Set the iframe SRC dynamically in JavaScript with setTimeout

Set the iframe SRC dynamically in JavaScript with setTimeout
http://stevesouders.com/hpws/iframes-src-js.php

The onload event doesn't fire until all iframe SRC requests are completed. To avoid this, set the iframe SRC dynamically in JavaScript with setTimeout. This page contains an iframe. The SRC is set with the same URL from Iframe SRC Blocks that takes 10 seconds to load. Notice how the onload time is only a few hundred milliseconds because it's not blocked by the iframe SRC.

沒有留言: