This is possible, but you need to re-organize your code.
Try to remove all inline scripts and place them in the footer after jQuery.
e.g.:
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
- <script src="footer.js" type="text/javascript"></script>
- </body>
- </html>
footer.js source:
- $('#target_form').submit(function() {
- alert('Handler for .submit() called.');
- return false;
- });
You will have several benefits by doing that:
- the page is displayed faster because there is no need to wait for the 30 kb jQuery library
- the page is transfered faster because filesize is smaller as you do not have any inline scripts (pure html only)
- all your scripts are cacheable
youtube.com is one of the popular sites using this technique (look at their source).