Monday, September 7, 2015

JQuery OnLoad Functions

 <html>
<head>
    <script src="Scripts/jquery-1.7.2.min.js" type="text/javascript"></script>
    <script>
        $(document).ready(function () {

            /** work when all HTML loaded except images and DOM is ready **/
            alert(1);

        });

        $(function () {
            /** work when all HTML loaded except images and DOM is ready **/
            alert(2);
        });


        $(document).on('ready', function () {
            /** work when all HTML loaded except images and DOM is ready **/
            alert(3);
        });

        jQuery(document).ready(function () {
            /** work when all HTML loaded except images and DOM is ready **/
            alert(4);
        });
    </script>
</head>
<body>
    <div class="container">
        <ul class="list">
            <li>Text Here1</li>
            <li>Text Here2</li>
            <li>Text Here3</li>
            <li>Text Here4</li>
            <li>Text Here5</li>
        </ul>
    </div>
</body>
</html>

No comments:

Post a Comment