Follow by Email

Sunday, May 12, 2013

Redirecting to a internal webpage in Jquery

Let see how to redirect from a webpage to an internal webpage on a button click event.

Below is the Html code for this



<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1">
    <title></title>

    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
    <script type="text/javascript">

        $(document).ready(function () {
            $("#Button1").click(function () {
                location.href = "test.aspx"
            });
        });

    </script>
</head>
<body>

    <div>
        <input id="Button1" type="button" value="Redirect to a Internal Web page" />    
    </div>

</body>
</html>