top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to Redirect web page to another page using javascript?

+1 vote
334 views
How to Redirect web page to another page using javascript?
posted Feb 3, 2016 by Sathaybama

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote
 
Best answer

In this example we will see how to redirect one web page to another web page using javascript. we need to set the redirect url to window.location.href, then the web page will be redirect to given url.

Syntax: window.location.href = "url here";

Source Code

<html>
<head>
    <title></title>
    <script language="javascript">
        function redirectwebsite() {
            var url = document.getElementById("txtwebsiteurl").value;
            window.location.href = url;
        }
    </script>
</head>
<body>
    Redirect this web site to
    <input type="text" id="txtwebsiteurl" value="http://www.dotnetlearners.com" style="width: 410px;" />
    <input type="button" value="Redirect" onclick="redirectwebsite();" />
</body>
</html>
answer Feb 3, 2016 by Shivaranjini
Similar Questions
+3 votes

I went through this Discussion:

http://stackoverflow.com/questions/7087036/fetching-images-from-server-while-drawing-the-cell

I have a web server server-1.example.com. There is a JSON-Server running on another server server-2.example.com. What I have to achieve is to fetch a list of URLs (in form of JSON response) from server-2 and loop through the urls and fetch them from the server-1. In the meantime i have to animate these images on the browser by Fading the images one after the another.

The algorithm is something like this:-

START:
   FETCH the URLs from server-1 and store them in a cache C
   Loop until C.length
      Fetch first K images by forking a thread.
      animate k images
 END

How can I optimize K? Is my approach right?

0 votes

I am building a multi-page rails web app and am struggling with finding a good JavaScript framework to use. I could use jQuery for all the low-level DOM manipulations but would like to benefit from the structure of a good framework.

...