Thursday, July 26, 2012

Asp.net jQuery Page Load Event Handler


The page load event can be handled using jQuery by adding a handler to the jQuery load event as follows.

$(window).bind("load", function(event) {
// Add your code here.
});

Example

Note: Change the reference of the jQuery
jquery-1.7.2.js files to point to your local directory.

<
html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Page Unload</title>
    <script type="text/javascript"
src="JavaScript/jquery-1.7.2.js"></script>
    <script type="text/javascript"
language="javascript">
    $(document).ready(function() {
        //
        // Page Load Event Handler
 $(window).bind("load", function(event) {           
         alert('Welcome !!!');       
});
    });
    </script>
</head>
<body>
    
</body>

Search Flipkart Products:
Flipkart.com

No comments: