answersLogoWhite

0

To redirect a user using javascript, include this in your <head> section:

<script type="text/javascript">window.location.href = "http://example.com";</script>

Note that such redirection should be avoided where possible. It's a legacy practice that really should no longer be used/available.

If you have access to your HTTP server, you are best advised to use the redirection tools/configurations that server provides. If you are just moving a document, you would best simply provide a page that displays a link to the new page to tell the visitor it has permanently moved, and to update their direct links.

Better yet: don't move the page.

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

How does one submit a form using JavaScript?

You can submit a form with Javascript by using certain code which allows you to firstly create a form then nest this with a button that will submit when, for example, a user clicks on it.


How do you redirect your website to an optimized iPhone version?

Put this code on the webpage you want to redirect: &lt;script language=javascript&gt; &lt;!-- if((navigator.userAgent.match(/iPhone/i)) (navigator.userAgent.match(/iPod/i))) { location.replace("*REDIRECT LINK HERE*"); } --&gt; &lt;/script&gt;


Tell you about asynchronous JavaScript and XML?

I do not know in depth. But using the Asynchronous Javascript and XML HTTP Request one can easily access the concept of AJAX. simply ajax is an technique of many technologies such as Javascript, XMLhttprequest, css and dom. Take the new registration of E- mail id when you are a new user. You can suggest an user name by this technique.


Which JavaScript event is triggered when the user activates an object?

onFocus


Web Designing?

A web designing course teaches the fundamentals of creating visually appealing and user-friendly websites using HTML, CSS, and JavaScript.


How do you create a biodata form using javascript?

To create a biodata form using JavaScript, you can start by designing an HTML form with input fields for personal details such as name, age, gender, and contact information. Use JavaScript to handle form submission by adding an event listener to the form that captures user input. Validate the data to ensure all required fields are filled correctly, and then either display the collected information on the page or send it to a server using AJAX. Optionally, you can style the form using CSS for better user experience.


How do you check length of password using javascript?

Use the length property of string in javascript.


What is the purpose of using Javascript in HTML?

JavaScript is used to manipulate HTML output after the user has downloaded the file. This allows the page to respond to the user's input in a dynamic way. Originally, developers and designers used this ability to create more fluid interfaces, delivering an experience to the user that was closer to the one they had come to expect from native software applications. With the widespread adoption of AJAX JavaScript is now able to contact the server and bring new content into the page without having to reload the entire page from the internet.


Why does Firefox redirect to Suggested sites?

Because Google pays Firefox for the traffic and user data. You can turn these misfeatures off in about:config or by using Firefox version 2 or earlier.


What are the benefits of using PHP redirect?

When using PHP redirect, you can redirect potential online traffic to the correct website, making it faster and simpler for the consumer. When the consumer is happy, it means more money in your pocket.


What does the abbreviation YUI stand for?

YUI is abbreviated for Yahoo User Interface Library. It is an open-source JavaScript library used to create applications using various methods of scripting.


How do you redirect users on a website?

If using a server-side language, you may output a "Location" header that tells most modern browsers to immediately redirect there. Alternatively, you may use the "meta" HTML tag: The integer (number 5) should be replaced with the number of seconds you want the user to have to wait to be redirected to another page. The URL should be replaced with URL you want the user to be redirected to.