Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,153,919 members, 7,821,219 topics. Date: Wednesday, 08 May 2024 at 10:01 AM

Making A Web Link Open Up In A New Browser Window - Webmasters - Nairaland

Nairaland Forum / Science/Technology / Webmasters / Making A Web Link Open Up In A New Browser Window (1471 Views)

Why You Are Not Making A Kobo From Your Blog / Best Web Link Directory / Fatal Error On Web Link Need Help Can You? (2) (3) (4)

(1) (Reply) (Go Down)

Making A Web Link Open Up In A New Browser Window by Nobody: 5:05pm On Jun 21, 2011
I have a web link that I want to automatically open up in a new browser window when it is clicked by anybody, is there anything that could be done?
Re: Making A Web Link Open Up In A New Browser Window by Bossman(m): 11:28pm On Jun 21, 2011
This can certainly be done. Can't remember off the top, but I believe you have to specify new in addition to other attributes in the Javascrip function or so that is associated with the link. Just Google for it.
Re: Making A Web Link Open Up In A New Browser Window by Fayimora(m): 11:47pm On Jun 21, 2011
Yeah you can do that with javascript. just add an onClick attribute to your anchor tag and call a function which would be defined in the header of your page. So lemme just give an example off the top of my head,

<a href="" onclick="open()" > </a>


so in your head tags you should have something like this:


<script>
   function open(){
     window.open(http://www.google.co.uk);
   }
</script>


That should do your magic. Now if you have other links that would do that same, you can make you method very useful. You just need a slight change. this time you just make the function receive an argument which would be the link that would be opened. Would leave you to figure it out.


NB: This topic should be in the webmasters zone so it would be moved in less than 24hrs
Re: Making A Web Link Open Up In A New Browser Window by GreenPrnce: 11:56pm On Jun 21, 2011
In ur <A> html link, set the TARGET attribute's value to PARENT i.e <A href="xxxxxx.html" target = "parent">mylink</A>
Pls let me know if it solved it.
Re: Making A Web Link Open Up In A New Browser Window by iwantto(m): 12:09pm On Jun 22, 2011
The right way to make a URL or web link open in a new window is by setting the target attribute to "_blank". See an example below:

<a href="http://cnn.com" target="_blank">Visit CNN Breaking News</a>

Hope this help!
Re: Making A Web Link Open Up In A New Browser Window by Nobody: 12:56am On Jun 23, 2011
Thanks to everyone, but I am not programmer and all the code you have suggested has gone well over my head!

It maybe that I have not made my question clear enough or that , you are making assumptions that I understand programming, and have missed out explaining all the steps.

All I want is to know how I can make the following link open up in new browser window?
http://www.itnsource.com/shotlist//ITN/1982/11/24/AS241182017/?s=nigeria&st=2&pn=95

I tried below but it boviosly did not work, what am I doing wrong?

[a href="http://www.itnsource.com/shotlist//ITN/1982/11/24/AS241182017/?s=nigeria&st=2&pn=95" target="_blank"]Visit CNN Breaking News[/a]
Re: Making A Web Link Open Up In A New Browser Window by iwantto(m): 10:58am On Jun 23, 2011
@GenBuhari,

Setting the target to _blank will definitely fixed the problem. The tag to use is "<" not "[". See my example below again.

<a href="http://www.itnsource.com/shotlist//ITN/1982/11/24/AS241182017/?s=nigeria&st=2&pn=95" Target="_blank">ITN SOURCE Nigeria</a>

This will definitely fixed the problem. I just tested it now and it worked.
Re: Making A Web Link Open Up In A New Browser Window by Nobody: 3:00pm On Jun 24, 2011
<a href=http://www.itnsource.com/shotlist//ITN/1982/11/24/AS241182017/?s=nigeria&st=2&pn=95  Target=_blank>ITN SOURCE Nigeria</a>

what am i doing wrong? sad
Re: Making A Web Link Open Up In A New Browser Window by yawatide(f): 3:39pm On Jun 24, 2011
Correct version (note the double quotes):
<a href="http://www.itnsource.com/shotlist//ITN/1982/11/24/AS241182017/?s=nigeria&st=2&pn=95" Target="_blank">ITN SOURCE Nigeria</a>
Re: Making A Web Link Open Up In A New Browser Window by Nobody: 8:15pm On Jun 27, 2011
+2
Re: Making A Web Link Open Up In A New Browser Window by Nobody: 6:54am On Jun 28, 2011
But when I post the link on the thread as you suggested and then click on it, it does not open in a new browser window.
Re: Making A Web Link Open Up In A New Browser Window by iwantto(m): 10:20am On Jun 28, 2011
GenBuhari:

But when I post the link on the thread as you suggested and then click on it, it does not open in a new browser window.

You can't post the link on this forum and get it to work. This forum post field uses bbcode editor which do not allow HTML tags to work because of security issues.

I guess you need to study HTML a little bit to understand this. We can give you all the advice we can  and if you don't know how to implement it, we will be wasting your time and our time.

Visit the link below to learn HTML basics. It won't take you 2hours to get going.
http://w3schools.com/html/default.asp
Re: Making A Web Link Open Up In A New Browser Window by Nobody: 11:41am On Jun 28, 2011
ok
so is there any way to get it happen on this forum?
Re: Making A Web Link Open Up In A New Browser Window by Nobody: 11:35pm On Jul 04, 2011
Alternatively,can someone show me how to embed streaming videos on this forum (other than youtube video, which i kow about
Re: Making A Web Link Open Up In A New Browser Window by Fayimora(m): 11:08am On Jul 09, 2011
get the code from the video host or create your own iframe
Re: Making A Web Link Open Up In A New Browser Window by Nobody: 12:43pm On Jul 09, 2011
would it be easy for a non-programmer like myself to do?

would it allow me to embed videos on this forum?

or can the videos be easily converted to youtube format for embedding?
Re: Making A Web Link Open Up In A New Browser Window by Fayimora(m): 1:55pm On Jul 09, 2011
And why do you want to embed vids on this forum? Why don't you just drop a link to your video wherever it is? I don't think you would be able to embed anyway
Re: Making A Web Link Open Up In A New Browser Window by Nobody: 3:03pm On Jul 09, 2011
ok.
thanks for helping
Re: Making A Web Link Open Up In A New Browser Window by Skulboy(m): 5:46pm On Jul 28, 2011
GenBuhari, I don't really know what you want anymore.

Your problem has been solved but if you still need more help, visit http://www.htmldog.com to sort out your problem.
Re: Making A Web Link Open Up In A New Browser Window by monteriza(m): 11:31am On Jan 31, 2012
Just trying <a href="http://patrickokunima..com"Target="_blank"> Click</>
Re: Making A Web Link Open Up In A New Browser Window by Fayimora(m): 11:36am On Jan 31, 2012
target="_blank" opens in a new TAB not window.
Re: Making A Web Link Open Up In A New Browser Window by monteriza(m): 8:22pm On Jan 31, 2012
Re: Making A Web Link Open Up In A New Browser Window by GreyBeard: 1:10pm On Feb 01, 2012
Fayimora:

target="_blank" opens in a new TAB not window.

That's probably because your web browser has been set to open these up in new tabs instead of new windows.

(1) (Reply)

Nairaland Frontpage Suggestion / Help Out With My Paypal Issues / I Am In Need Of Fresh Google Voice Numbers

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 26
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.