MozillaZine

Failure in my html commands

Discuss how to use and promote Web standards with the Mozilla Gecko engine.
mlassiter
 
Posts: 90
Joined: June 27th, 2007, 12:05 pm
Location: San Francisco, CA

Post Posted December 21st, 2018, 12:35 pm

Firefox does not seem to obey one of the html commands in my web page. The command I have is:

<br><font size=-1> <a href="http://forums.mozillazine.org/ucp.php?mode=login" target="_blank">Mozilla Forums Login</a></font>

The part that seems to fail is: target="_blank". It is supposed to open the URL in another window but, instead, it opens in another tab. I have used this for many years under Seamonkey and it has worked correctly. To give Firefox credit, it also does not work in Chrome, Edge, nor Internet Explorer.

Does anyone have a solution ... perhaps a target other than "_blank"?

therube

User avatar
 
Posts: 20061
Joined: March 10th, 2004, 9:59 pm
Location: Maryland USA

Post Posted December 21st, 2018, 1:54 pm

Check your "link behavior" settings in FF (& Chrome, Edge, IE).

If you have it set to open in a new/current tab, your html code will do that.
If you have it set to open in a new window, your html code will do that.


In SeaMonkey, the Pref is, http://kb.mozillazine.org/Browser.link.open_newwindow.
(Don't know if that is the same in FF?)
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball CopyURL+ FetchTextURL FlashGot NoScript

DanRaisch
Moderator

User avatar
 
Posts: 122168
Joined: September 23rd, 2004, 8:57 pm
Location: Somewhere on the right coast

Post Posted December 21st, 2018, 2:29 pm

Moving to Web Development as the issue appears in browsers other than Firefox.

jscher2000

User avatar
 
Posts: 10743
Joined: December 19th, 2004, 12:26 am
Location: Silicon Valley, CA USA

Post Posted December 21st, 2018, 4:26 pm

Here's a test page for experimenting with preferences and the window.open() script command:

https://www.jeffersonscher.com/res/popit.html

mlassiter
 
Posts: 90
Joined: June 27th, 2007, 12:05 pm
Location: San Francisco, CA

Post Posted December 27th, 2018, 2:30 pm

therube: I could not figure out hot to check my "link behavior" settings. Is this somewhere in the "options" setting?

DanRaisch: I can see that you are able to open a page in a new window but I cannot determine how to have this done by just clicking on a button or making a change to the HTML commands in my web page. Also here is a web site that seems to say that I have set up my HTML commands correctly but Firefox does not handle it properly.

jscher2000

User avatar
 
Posts: 10743
Joined: December 19th, 2004, 12:26 am
Location: Silicon Valley, CA USA

Post Posted December 27th, 2018, 3:43 pm

Hi mlassiter, if the user prefers that new windows open in a new tab instead, why not allow a new tab? What's the problem?

mlassiter
 
Posts: 90
Joined: June 27th, 2007, 12:05 pm
Location: San Francisco, CA

Post Posted December 28th, 2018, 2:16 pm

DanRaisch: I guess I should have described my web page with more detail. My web page is a file on my PC --- no one else has access to it. It consists of around 50 URLs which are my most used bookmarks. So, when I click on one of them, I want it to open (as it used to do in Netscape and Seamonkey) in another new window and not in a tab on the same window as the web page of bookmarks.

makaiguy

User avatar
 
Posts: 16783
Joined: November 18th, 2002, 6:44 pm
Location: Somewhere in SE USA

Post Posted December 28th, 2018, 4:09 pm

In the old days before browsers started using tabs, the target="_blank" parameter was created to specify that a link should be opened in a new window, instead of replacing the content in the current window.

When tabs were introduced, Firefox's predecessor added a preference you could set for your browser where you could specify you wanted links which would have opened in new windows to be opened in new tabs in the present window instead. This is all or nothing -- all such links will open in either a new window or a new tab, according to the preference you've selected. The only way you can choose for any given link is by right clicking on the link and selecting whether to open in a new window or new tab.

As far as I know, no way ever has been added to HTML to specify whether an individual link is to be opened in a new tab or new window. Your two options are:
  • target="_self" if the link is to replace the contents of the current window or tab. This is the default action if no target value is specified.
  • target="_blank" if the link is not to be opened in the current window or tab.
Doug Wilson, "The Makai Guy"
Win10 (64bit): FF Quantum 70.0.1 (64bit), TB 60.9.0 (32-bit) ║ Android 8.0/7.1.1: FF Mobile 68.2.0, No TB for Android available, dammit!
What a fool believes he sees, no wise man has the power to reason away - Doobie Brothers

jscher2000

User avatar
 
Posts: 10743
Joined: December 19th, 2004, 12:26 am
Location: Silicon Valley, CA USA

Post Posted December 28th, 2018, 6:03 pm

Hi mlassiter, did you look at my test page that I linked to earlier?

https://www.jeffersonscher.com/res/popit.html

Do you get the third link behaving different from the second link?

mlassiter
 
Posts: 90
Joined: June 27th, 2007, 12:05 pm
Location: San Francisco, CA

Post Posted December 30th, 2018, 3:39 pm

makaiguy: Thanks. that pretty much tells me that I can't really achieve what I would like. I guess I shall just have to use the "right click" method to get a new window.

Return to Web Development / Standards Evangelism


Who is online

Users browsing this forum: No registered users and 2 guests