5 Replies - 2281 Views - Last Post: 18 May 2009 - 12:14 AM

#1 Glorfindal   User is offline

  • Java Enthusiast
  • member icon

Reputation: 37
  • View blog
  • Posts: 607
  • Joined: 31-December 08

Opening a link in a new tab.

Posted 17 May 2009 - 02:47 PM

What is the code to open a link in a new tab. I need to know this for information center I'm creating about Runescape.
Here's a zipped folder with all the data. And yes I have scanned my computer for viruses.
Attached File  zipped_runescape_info.zip (27.35K)
Number of downloads: 174

Is This A Good Question/Topic? 0
  • +

Replies To: Opening a link in a new tab.

#2 du_jleon   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 33
  • Joined: 26-March 09

Re: Opening a link in a new tab.

Posted 17 May 2009 - 02:58 PM

View PostGlorfindal, on 17 May, 2009 - 01:47 PM, said:

What is the code to open a link in a new tab. I need to know this for information center I'm creating about Runescape.
Here's a zipped folder with all the data. And yes I have scanned my computer for viruses.
Attachment attachment


Good question, I too would like to know. My job is requesting this "quick" fix, but I don't know how to do it.
Was This Post Helpful? 0
  • +
  • -

#3 joezim007   User is offline

  • D.I.C Head
  • member icon

Reputation: 11
  • View blog
  • Posts: 110
  • Joined: 13-September 08

Re: Opening a link in a new tab.

Posted 17 May 2009 - 03:02 PM

View Postdu_jleon, on 17 May, 2009 - 02:58 PM, said:

View PostGlorfindal, on 17 May, 2009 - 01:47 PM, said:

What is the code to open a link in a new tab. I need to know this for information center I'm creating about Runescape.
Here's a zipped folder with all the data. And yes I have scanned my computer for viruses.
Attachment attachment


Good question, I too would like to know. My job is requesting this "quick" fix, but I don't know how to do it.


In short... you can't. There is no target attribute to open in a new tab because the HTML specification was made before tabs. The thing is, though, most browsers are configured by default so that anything that is supposed to be opened in a new window, will open in a new tab. Some people change this setting, but it is the closest thing you've got. Just use target = _blank.
Was This Post Helpful? 0
  • +
  • -

#4 Glorfindal   User is offline

  • Java Enthusiast
  • member icon

Reputation: 37
  • View blog
  • Posts: 607
  • Joined: 31-December 08

Re: Opening a link in a new tab.

Posted 17 May 2009 - 05:02 PM

Could give me the whole example code? :)
Was This Post Helpful? 0
  • +
  • -

#5 joezim007   User is offline

  • D.I.C Head
  • member icon

Reputation: 11
  • View blog
  • Posts: 110
  • Joined: 13-September 08

Re: Opening a link in a new tab.

Posted 17 May 2009 - 05:08 PM

View PostGlorfindal, on 17 May, 2009 - 05:02 PM, said:

Could give me the whole example code? :)

Inside a link you use target="_blank" like this:
<a href="some.url" target="_blank">Some Link</a>


Was This Post Helpful? 1

#6 gregwhitworth   User is offline

  • Tired.
  • member icon

Reputation: 221
  • View blog
  • Posts: 1,613
  • Joined: 20-January 09

Re: Opening a link in a new tab.

Posted 18 May 2009 - 12:14 AM

Yeah, either way it all depends on how the user has set up their browser. As long as you have the _blank in there it will at least leave your page open, whether it opens in a whole new window or simply a new tab.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1