use jquery dollar function as equivalent of document.ready