If you load your JavaScript with <script> tags - either inline scripts or
external file references - there is nothing to wait for.  Simply put your
code after all other <script> tags that you rely on. For example:

    <script type="text/javascript" src="jquery.js">
    </script>

    ...

    <script type="text/javascript">
        function foo() {}
        var bar = {};
    </script>

    ...

    <script type="text/javascript">
        // all of these will alert the expected objects:
        alert( jQuery );
        alert( foo );
        alert( foo );
    </script>

Do you load your scripts with <script> tags, or do you have any dynamically
loaded scripts? Those would require different handling.

-Mike

> From: Veeru
> 
> Hi there,
> I was wondering if there is something like document.ready; to 
> trigger after all the DOM+Js is loaded. document.ready is 
> triggered when the DOM is ready, but the js might be still 
> loading, i would like to trigger an event only after DOM 
> along with all the JS is loaded. Any way to do this?
> 
> Thanks
> Vru
> 

Reply via email to