How do u make a Link open a new window?

  • reddragonlf
  • Newbie
  • Newbie
  • reddragonlf
  • Posts: 9

Post 3+ Months Ago

Yeah what is the code for making a link open in a new window?
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Axe
  • Genius
  • Genius
  • User avatar
  • Posts: 5739
  • Loc: Sub-level 28

Post 3+ Months Ago

<a href="whatever" target="_blank">text</a>
  • reddragonlf
  • Newbie
  • Newbie
  • reddragonlf
  • Posts: 9

Post 3+ Months Ago

yep that does it.... thanks again Axe
  • Axe
  • Genius
  • Genius
  • User avatar
  • Posts: 5739
  • Loc: Sub-level 28

Post 3+ Months Ago

no problem :)
  • David
  • Graduate
  • Graduate
  • David
  • Posts: 165

Post 3+ Months Ago

Neat!


I wanted to find out that aswell, heh, thanks Axe.

David.
  • aloof
  • Newbie
  • Newbie
  • aloof
  • Posts: 14
  • Loc: Oregon

Post 3+ Months Ago

Do you always have to target _blank?

I was under the impression just targetting an undefined reference would always open it in a new window.
  • digitalMedia
  • a.k.a. dM
  • Genius
  • User avatar
  • Posts: 5149
  • Loc: SC-USA

Post 3+ Months Ago

That is correct aloof. However there are some predefined targets that allow for some special functionality.

_blank - the target URL will open in a new window
_self - the target URL will open in the same frame as it was clicked
_parent - the target URL will open in the parent frameset
_top - the target URL will open in the full body of the window

The above was taken from this site ---> http://www.w3schools.com/tags/tag_a.asp
  • DR01D
  • Expert
  • Expert
  • User avatar
  • Posts: 661
  • Loc: Australia

Post 3+ Months Ago

you can also open up a window using javascript, this also lets you stip the browser nav buttons, scroll bars, etc and you can also set the window sizes in pixels.
  • Axe
  • Genius
  • Genius
  • User avatar
  • Posts: 5739
  • Loc: Sub-level 28

Post 3+ Months Ago

The problem with using something like....

target="something", means that if you have two links on your page, like...

<a href="http://www.google.com" target="something">Link 1</a>
<a href="http://www.yahoo.com" target="something">Link 2</a>

When the new browser window opens up, that browser window will have the name "something". So any future links with target="something" will load in that window.

Try it, click on Link 1, don't close the browser window once it loads, then click on Link 2.

If, however, you use target="_blank", like this..

<a href="http://www.altavista.com" target="_blank">Link 3</a>
<a href="http://www.lycos.com" target="_blank">Link 4</a>

They will open up in brand new windows regardless of what already exists in memory.

Try it, click on Link 3, leave the window open and click on Link 4 :)

So you CAN use anything you want as the target, but anything else with the same target (as long as the window remains open) will be displayed in that window.
  • Hacker007
  • Proficient
  • Proficient
  • User avatar
  • Posts: 371
  • Loc: Riverside, CA

Post 3+ Months Ago

and of course there is the "target=iframe1" wich opens a page inside the page.... :?
  • Axe
  • Genius
  • Genius
  • User avatar
  • Posts: 5739
  • Loc: Sub-level 28

Post 3+ Months Ago

if you have a frame named "iframe1" it does... Otherwise it'll open it in a new window called iframe1

<a href="http://www.google.com" target="iframe1">iframe1</a>

Post Information

  • Total Posts in this topic: 11 posts
  • Users browsing this forum: No registered users and 46 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.