Niketa Posted January 2, 2013 Share Posted January 2, 2013 Hello everyone! I am using a tab/(app) on Facebook to redirect to a website, I have coded it to redirect to a website in a new tab by the ordinary: <a href="https://URL" target="_Blank">Link!</a> In this case one have to click the hyperlink for it to redirect to the new tab. Is there a code that redirects without (cliccking a) hyperlink? Opens in a new tab by just clicking the app? Thank you so much!Niketa Link to comment Share on other sites More sharing options...
DarkxPunk Posted January 3, 2013 Share Posted January 3, 2013 (edited) window.open( 'https://support.wwf.org.uk/earth_hour/index.php?type=individual', '_blank' // <- This is what makes it open in a new window.);That's js, use it in a function and call it onclick of any image, div, word, etc. Edited January 3, 2013 by DarkxPunk 1 Link to comment Share on other sites More sharing options...
manojnaanak Posted January 3, 2013 Share Posted January 3, 2013 try this... <meta http-equiv="refresh" content="5; URL=http://www.google.com"> 1 Link to comment Share on other sites More sharing options...
Niketa Posted January 4, 2013 Author Share Posted January 4, 2013 Thank you so much!Darkxs Punk, Do you know the code for HTML? Manojnaanak, it redirected to open within the same tab and inside the iframe (not even as a full window) is there something to add to the meta for it to redirect into a a new tab Thank you both! Link to comment Share on other sites More sharing options...
Ingolme Posted January 4, 2013 Share Posted January 4, 2013 The <meta> tag only works on the current window. In HTML you just put the Javascript between <script> tags and it will work. 1 Link to comment Share on other sites More sharing options...
DarkxPunk Posted January 4, 2013 Share Posted January 4, 2013 (edited) I will give you this one freebie but learn js! <!doctype html><html> <head> <title>NewTab</title> <style>#newTab { margin: 0 auto; border: 1px solid #000000; padding: 25px; width: 50px; height: 50px; background: red; color: #ffffff; } </style> <script> function newTab() { window.open( 'about:blank','_blank' ); } </script> </head> <body> <div id="newTab" onclick="newTab()">NewTab</div> </body></html> the on click can be used on most any element. You can also put the js in the body, but put it before your button. Edited January 4, 2013 by DarkxPunk 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now