Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I redirect with JavaScript? [duplicate]

How do you redirect to a page from another page with JavaScript?

like image 375
Lucky13 Avatar asked Jan 20 '11 08:01

Lucky13


People also ask

How do I link one JavaScript page to another?

Answer: Use the JavaScript window. location Propertylocation property to make a page redirect, you don't need any jQuery for this. If you want to redirect the user from one page to another automatically, you can use the syntax window. location. replace("page_url") .

Can you redirect a page to another page using JavaScript How?

It is quite simple to do a page redirect using JavaScript at client side. To redirect your site visitors to a new page, you just need to add a line in your head section as follows.

How do I redirect a link to another page in HTML?

How to Redirect to Another Page in HTML. To redirect one HTML page to another page, you need to add a <meta> tag inside the <head> section of the old HTML page. The <head> section of an HTML document contains metadata that is useful for the browser, but invisible to users viewing the page.


1 Answers

To redirect to another page, you can use:

window.location = "http://www.yoururl.com"; 
like image 74
seedg Avatar answered Sep 30 '22 08:09

seedg