I want to execute a script after the whole page has loaded, when it's complete.
The current way is:
window.onload=document.getElementById('loaded').value=1;
Which is not good, as some images are still in load, and the page has not completed loading truly. What I am doing wrong?
Certainly doesn't work for me in Chrome and Firefox. The thing is I launch a code after, that returns status 204, and this blocks future loads. But it seams this 204 status is returned way before the page has finished loading. So I need to execute my code after the page has truly loaded.
EDIT
setup a page, that does framebreaking
<iframe id="myframe" height=1 width=1></iframe>
<script type="text/javascript">
window.onload=document.getElementById('myframe').src='http://link to a frame braker page';
</script>
when you put the above code to a page, it loads the iframe before the page is fully loaded. Simply put an alert in the iframe page, and try out on a slower server where your parent page contains large images etc..