import domready = require("domready"); domready(function () { // dom is loaded! })