Related Posts Plugin for WordPress, Blogger...

About

Follow Us

Monday, 2 February 2015

Some times we require that when some one visit  www.abc.com  then he should be redirected to another site like www.xyz.com. So for that we need to add piece of javascript code in the head tag of the default page of the website and it will automatically redirect the www.abc.com visitor to  www.xyz.com site. 


Lets create an web application to redirect visitor from one website to another website using 
JavaScript

  • In the <HEAD> tag create a JavaScript function as:

<head runat="server">
    <title></title>

    <script language="javascript" type="text/javascript">
       location.replace("http://www.xyz.com");     
    </script>
</head>
Categories: ,

0 comments:

Post a Comment