I have a page with <form> tag. Inside a form there is a lot of html plus some inline JavaScript at the very end of the <form> tag.
I listen to document load event. Can I be 100% sure, that when document load will be fired, all this inline JavaScript code has been already executed?
Example of markup:
<body>
<form>
--html controls---
<script type="text/javascript">
--some code to run here--
</script>
</form>
</body>
My thoughts that answer is yes, inline JavaScript will be executed before document load, but I want to find evidence.
edit
live demo
Document load fires only when all html controls loaded and JavaScript (inline or with src attribute)loaded and interpreted. Am I correct with this statement?
Unless you put the code you want to execute in the domready callback function, your inline javascript code will be executed immediately when you load the page (before the the domready).