Redirection to another url with javascripts

There are some simple ways to use javascript redirect the page to another page
<br />Using Pure Javascript

1. Redirect to anther page

<script type=”text/javascript” language=”javascript”>
    window.location.href=”Your url here”;
</script>

OR

<script type=”text/javascript” language=”javascript”>
    self.location = “Your url here”;
</script>

OR

<script type=”text/javascript” language=”javascript”>
    window.nagivate(“Your url here”);
</script>

2. Redirect to previous page (go Back)

<script type=”text/javascript” language=”javascript”>
    window.history.back(-1);
</script>

Using Jquery

$(location).attr(‘href’, ‘Your url here’);




Related posts:

Share

About number.0