Wednesday 20 May 2015

Simple Example - how to redirect using jQuery

Watch this example on YouTube:



<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="jQueryRedirect.aspx.cs" Inherits="WebApplication1.jQueryRedirect" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $(location).attr('href', 'http://microsoft.com');
        });
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
   
    </div>
    </form>
</body>
</html>

No comments:

Post a Comment