How to write in JS to check if everything has loaded on a page
<p>I am using loadrunner to test an AJAX app. 
It has the facility to write/include javascript into it. 
My question is how can I check if the portlet is loaded fully.
Can I be able to use window.onload in loadrunner javascript for an object/frame/portlet.
any example?</p>
