Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

On load, redirect page in new tab/window

Tags:

html

redirect

I have access to a page template but no access to the header template (don't ask me how!), I need to create an instant page redirect on that template. It's needs to open in a new window.

It doesn't really matter how it's done just that it opens in a new window and please bear in mind I don't have access to the header template.

like image 456
Rob Avatar asked Jun 02 '11 15:06

Rob


People also ask

How do I make new tabs open redirect?

The href attribute set to the URL of the page you want to link to. The target attribute set to _blank , which tells the browser to open the link in a new tab/window, depending on the browser's settings.

How do I automatically redirect a page?

To redirect from an HTML page, use the META Tag. With this, use the http-equiv attribute to provide an HTTP header for the value of the content attribute. The value of the content is the number of seconds; you want the page to redirect after.

How do I redirect the next page?

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

I could be a bit off here (please correct me if i am) but,
you just the page to open a new page then something like this

See this for detailed usage of window.open.

You can pass html into the function as well.

<body onload="window.open(yourwindow)">

Or if you were just wanting a redirect to an existing page then

See this for detailed usage of window.location.

<body onload=window.location='www.yourlocation.com'>

Pass that whatever you want for parameters into the url.

Or if you were looking to grab some info from the page before you transition then you could just write a function that grabs the data you need from the header and pass that to the new page.

like image 188
Terrance Avatar answered Oct 04 '22 03:10

Terrance