there are two ways to do this in jquery depending what you are looking for..
using jquery you can do
//this will wait for the text assets to be loaded before calling this (the dom.. css.. js)
$(document).ready(function(){...});
//this will wait for all the images and text assets to finish loading before executing
$(window).load(function(){...});