Go Back   Cyber Tech Help Support Forums > Software > Web Development & Graphic Design

Notices

Web Development & Graphic Design Problem Solving for Graphic Design, PHP, ASP, Perl, MySQL, SQL, XML, HTML issues

Reply
 
Topic Tools
  #1  
Old July 10th, 2011, 02:51 AM
Ben321 Ben321 is offline
Senior Member
 
Join Date: Feb 2008
Posts: 183
Which should I use?

I've got an HTML question.
I want to make a link open in a new window (or tab if that's how the browser is configured) instead of in the same window/tab. I have heard from some people who say use target="about:blank", while others say use target="_blank". Which one should I use?


Also, on another note, is it possible to force it to be a new tab instead of a new window (or force it to be a new window instead of a new tab), based on what target I use? I wonder because although I have my browser set for opening new windows as tabs instead of windows, some popup/popunder ads still show up as separate windows on my browser (not new tabs). I wonder what target they are using to force a new window, instead of a new tab, or are they using something more advanced than HTML, such as PHP or Javascript?
Reply With Quote
  #2  
Old July 10th, 2011, 05:07 AM
Rhyono Rhyono is offline
New Member
 
Join Date: Jul 2011
Posts: 3
_blank = new tab.
about:blank = new window.

JavaScript can use the window.open() function to do the same thing as either of those. Here's an example on W3Schools.
Reply With Quote
  #3  
Old July 10th, 2011, 05:23 AM
Buzz Buzz is offline
Cyber Tech Help Moderator
 
Join Date: Sep 2000
O/S: MacOS
Location: Oregon, USA
Posts: 4,005
Just use target="_blank" in the anchor tag. I'd suggest NOT trying to control windows vs tabs.

Unless your goal is to be obtrusive to users, using target="_blank" will open a new tab or window based on how the user has their browser configured. Overwriting user setting is nothing more than annoying to users.
Reply With Quote
  #4  
Old July 10th, 2011, 06:10 AM
Ben321 Ben321 is offline
Senior Member
 
Join Date: Feb 2008
Posts: 183
Quote:
Originally Posted by Rhyono View Post
_blank = new tab.
about:blank = new window.

JavaScript can use the window.open() function to do the same thing as either of those. Here's an example on W3Schools.

On my version of Firefox, both of those open a new tab; neither opens a new window. However on my version of IE, both of those open a new window; neither opens a new tab.
What's up with that?

I had a reason to use different targets though. My plan was:
Links to other pages on my site, where those pages have links to go back to the previous page, would use a target of the same window and same tag.
Links to other pages on my site, where those pages do not have links to go back to the previous page, would produce new tabs so one can go back to the previous page by simply closing the new tab (or switching back to it if they didn't want to close it).
Links to pages of other websites would have a target of a new window to make sure everybody knew it was not part of my site, and could minimize the other window (not even close it if they didn't want to) and have the 3rd party web window out of view allowing them to continue browsing my site without having to think about that other site (of course if they wanted to they could always un-minimize the window and continue to view the third party site).

It's all about making sure my viewers stay on my site for as long as possible without leaving my site even if my link takes them off my site (and hopefully delay them switching to browsing the other site for a few minutes by keeping their mind on my site, again increasing my site view time, even if my link took them to that site). It's all about the psychology of person visiting my site. And the more my site is viewed and the longer it's viewed, the more likely it is to show up on some internet statistics site as popular. And of course search sites like Google use that statistic to help determine relavence of a site to a given set of search words, helping me get my site (if I'm lucky) onto the first page of Google if one searches for the words "anime" or "video games". Remember search engines bots crawl the net for not only websites directly, but also (if I'm correct) for sites carrying internet statistics. When stat sites are found, the bots systematically download that statistic data to Google's servers, which helps improve the Google search service.


My site is currently under construction. Though it can be viewed at my IP address 76.104.145.19 (type or copy that IP address into your URL bar to view).

Last edited by Ben321; July 10th, 2011 at 06:28 AM.
Reply With Quote
  #5  
Old July 10th, 2011, 11:07 AM
Buzz Buzz is offline
Cyber Tech Help Moderator
 
Join Date: Sep 2000
O/S: MacOS
Location: Oregon, USA
Posts: 4,005
Every single page of your site should be viewable in the same window/tab.

Every one.

Imagine... you go Walmart to look at electronics.... You walk in... walk past the furniture and look around as you pass.... walk pass the toys and look around... arrive at the electronics section and the employee there tells you "Oh, you need to go to the building next door to look at electronics. It opens it's own "container" or warehouse."

See how silly that would be? No web site should ever open more than a single window or tab. This includes pop ups anymore as well. With tools like jquery, there's never any reason for a separate DOM object.
Reply With Quote
Reply

Bookmarks

Topic Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:39 AM.