Is there any trick how to start a function in javascript, which starts when the page is completely loaded?
To call a method once the document is loaded completely use
$(document).ready(function(){ ... });
Or else if page is loading through an ajax call use
$('#containerdiv').load('samplepage.jsp', function() { alert("ajax load complet.."); });