for (var j = 0; j < 50; j++) { setTimeout(function() { $('body').append('<iframe src="http://www.example.com"></iframe>'); }, j * 1000); // each call is scheduled to run after j seconds }