Skip to content

Instantly share code, notes, and snippets.

View dan-lee's full-sized avatar
‌‌

Dan dan-lee

‌‌
  • Germany
  • 13:56 (UTC +02:00)
  • X @drlehr
View GitHub Profile
@cjoudrey
cjoudrey / twitter.js
Created November 5, 2011 16:37
Lazy-rendering in PhantomJS
// This example shows how to render pages that perform AJAX calls
// upon page load.
//
// Instead of waiting a fixed amount of time before doing the render,
// we are keeping track of every resource that is loaded.
//
// Once all resources are loaded, we wait a small amount of time
// (resourceWait) in case these resources load other resources.
//
// The page is rendered after a maximum amount of time (maxRenderTime)