Should a link specify how it is to be opened? - html

For example HTML's href tag has a target attribute that can force the page to be opened in a new window. But conceptually is this a good idea? Should the content determine how the user should read it? Or should this be entirely up to the user (right click -> open in new window)?

I disagree. A link shouldn't be forced to open in a new window. If the user wants to open it in a new window then it is up to them.

Normally when we redirect to a link which is of the current site then it should/may open in the same window. But if the link redirects us to another sire then its better to open it in a new window so that the user will stick to our(current) site. There is no specific rule. It is mainly done as per client's requirement.
One drawback of in opening the link using right--> click is it makes the user do one extra click. In case your page has 5 links and the user wants to open them in new windows/tabs each time he/she has to do an extra click. This is just an example. It all depends what the user wants.....

Related

Canva.com, how can I have opend link in new tab

I am training to add links to my Canva project.
But I need links which one opens in new browser tab. Is anyone knows how to do this?
To link to another website page, enter the link, and press Enter on your keyboard or click anywhere on the editor.
To link to another page within the design, select the page you want to link to from the Pages in this document section in the dropdown.
To link to one of your recent designs, select it from the Recent section in the dropdown. Make sure have the right permissions to the design you’re linking to so it loads properly to your audience.

When should links open in new tab/window?

When exactly links should open in a new tab/window? I find that some of the actions which require certain operations in a new tab/window can be done on the same page using modal windows and then refreshing the same page to show the updated contents.
A couple of google searches gave me the following results:
Why external links should open in new tabs?
When if ever should links be opened in a new window?
Is there ever a good reason to force opening a new browser window?
Should links open in new windows?
Forcing links to open in new windows: an argument that should have ended 15 years ago
Some suggest that in case of external links they should be opened in a new tab/window, some suggest that they should be opened on the same page for simplified user control. Both of them sound correct in their own ways. Isn't there some sort of generalization? Or are there any particular situations where we cannot do without links opening in a new tab/window?
In other words, what are the situations where a link should open in a new tab/window OR in the same page (taking into account that modal windows are implemented frequently these days)?
Having external links opened in a new tab is better and done more often so that when you have a user surfing your site and clicks on an external link he doesn't have to go back but simply just needs to close that tab and can continuous surfing your site.
You have to bare in mind that not ever internet user knows how to work with a browser like you do (Still many lesser-intelligent people on the net).
add attribute target="_blank" on a tag
Link 1</strong></p>

Opening links in a specific tab - from an email

I have a registration system on my website which uses the common activation email trick.
This email simply contains instructions and a link to the activation page on my website.
So suppose I registered on the site, opened a new tab to check my emails and then clicked on the link, which will open in another new tab, resulting in two tabs open on the site (of which one is btw still telling them to o check their mail).
Is there a way to get the link in the email to open in the first tab on my website? (Or open a new tab if the previous one was closed or moved to another domain).
Thanks for any help/suggestions!
You can name your current window/tab with a JavaScript assignment:
<script type="text/javascript">
this.name = "mainWindow";
</script>
Then you use that name as value for the target attribute in links, like
<a href="nextPage.html" target="mainWindow">...
If mainWindow does not yet (or no more) exist, it will open in a new tab.
Update
The above stuff does not solve the OP's problem, because for links opened from emails, the target attribute will usually not be transferred from MUA to browser (except maybe for webmailers, but we cannot rely on this). So I was thinking of some kind of landing page which uses JavaScript to achieve the desired effect:
If target window/tab `mainWindow` has already been opened, focus it, perform activation there, and close ourselves.
If target window/tab does not exist, perform activation right where we are.
If this worked, you would only see a second open tab for a moment (case 1), before it closes itself. Yet it is not possible to "close ourselves", as I learned here and here - so in the end there would be a superfluous tab left, which should have been avoided. Seems like it cannot be done, sorry!

Can a browser window/tab target be (re)named?

I'd like a hyperlink on a page to open its site's landing page, in a new tab if it's not already open, or, if it is already open to have the browser switch to that tab.
My idea for this was to use the target attribute but the problem is that the tab for the landing page doesn't have a name that I can refer to.
So my question is, can a tab be named by the page loaded in it so that it can be referred to by the target attribute?
In general, no.
However, if you open a child "window" with JavaScript, you can retain a handle to that window and modify things that way.
In general, browsers control the behavior of how a link opens. Some default to open in the same viewport, others default to a new tab, and still others default to a new window entirely.
The best thing to do, however, is to not try to control this and instead allow the browser (and more importantly, the user) to decide how the clicked link should be opened. This allows your power users to control how they use your site, and at the same time keeps the behavior of the browser consistent for your users, which is a critical component in keeping your users happy.

How to invoke the same browser instance from a web link

I have a link on my web page. When I click it I open a new window and show content in that window.
I would like to be able, in a second time, to click again in that link and, instead of opening a new browser window/tab, to get the previous instance and put content on it.
Is it possible in some way?
Thanks in advance, greetings.
In HTML you do this by specifying a named target:
Link 2
Link 3
Link 4
All will open in the same window.
Note: If the user has their preferences set to open new windows in tabs, these will all reference the same tab (vs. window)