How to disable target=_blank [message #162940] |
Sat, 04 September 2010 17:01 |
milki
Messages: 1 Registered: September 2010
Karma: 0
|
Junior Member |
|
|
I have modifed my templates already to use HTML5 instead of XHTML, so it's not a technical problem. However I frown upon the usability aspect of that.
So how or where can I disable those oldschool target=_blank attributes? Is there an option for that, or if it's in the templates, which one? Or if FF is hardcoded to augment {url}s with targets, in which script?
Thanks!
mario
|
|
|
|
|
|
Re: How to disable target=_blank [message #162977 is a reply to message #162976] |
Mon, 13 September 2010 16:40 |
Ernesto
Messages: 413 Registered: August 2005
Karma: 0
|
Senior Member |
|
|
No, it should be kept in. You don't want to force users away from your page when they click links. It should most definitely open a new window/tab, you want users on your page as much as possible, not as little as possible. Out of all ideas you have had Sir, that was the terriblestestest! =)
Ginnunga Gaming
|
|
|
|
Re: How to disable target=_blank [message #163028 is a reply to message #162940] |
Sun, 19 September 2010 15:16 |
Ernesto
Messages: 413 Registered: August 2005
Karma: 0
|
Senior Member |
|
|
That would open all links into a new window, not just the links that are in a post.
I don't think that I have ever seen any forum software that doesn't open up links in posts in a new window/tab.
I don't see how target="_blank" would be bad practice, it's VERY widely used and it works great to keep a user on your site.
What is bad practice are javascript links to open up new windows, because those you cannot control on a user basis - IE, I often click links with my middle mouse to open them in a new tab (to be certain they open in a new tab, since i dont wanna navigate away from the current page) - but if its a javascript link, the opened page will not work, since the browsers cannot interpret it.
Mjeh, we often agree on much, but this one I have to say that me, and actually every single other forum software agrees, against you :po
Ginnunga Gaming
|
|
|
|
|
Re: How to disable target=_blank [message #163031 is a reply to message #163030] |
Sun, 19 September 2010 15:34 |
Ernesto
Messages: 413 Registered: August 2005
Karma: 0
|
Senior Member |
|
|
XHTML Strict is not, according to me, "most desired practice" etc etc.
People who are WC3 crazy would rip out target=_blank and replace it with onclick="window.open(this.href,'_blank');return false;" which actually IS bad practice, since it breaks the middle mouse button functionality in _ALL_ browsers.
Let's say my mom is visiting a forum that does not have target="_blank".
She is reading the recepie thread.
One post called "Bread" links her to the site "Bread'R'Us"
My mom clicks the link.
She enters the site Bread'R'Us, it loads a bit slow since its a bloated site. She navigates on that site with 3-4 clicks to get to a recepie she wants.
Now she wants to get back to that lovely forum and that magnificent thread that had tips of all the recepie sites!
So she hits her back button. Oh shit, since the site used a script to redirect her search for the recepie, a popup is prompted if she wants to submit the data again!
If course she doesnt want to do that, she clicks cancel and remains on her current page.
My mom tries to hit the back button again. Same prompt appears. My mom is now confused, but she clicks ok.
Boom, the search enables again, and she is STILL on the same page.
She is now desperate, so she is clicking the back button like a crazy person, and before the scripts on the page loads (the page is very slow, remember?) she manages to get back 2 pages, to the recepie list again on bread's'r'us but she doesnt know this, since its such a slow site.
She clicks the back button again, waits, page loads, still not the lovely forum thread.
OR
She clicks the link on the forum, a new tab appears and flashes. She clicks the tab, finds her recepies, then clicks the forum tab and she can view the little forum again!
For usability and user experience, I'd go with option number 2!
Ginnunga Gaming
|
|
|
Re: How to disable target=_blank [message #163032 is a reply to message #163027] |
Sun, 19 September 2010 15:36 |
Ernesto
Messages: 413 Registered: August 2005
Karma: 0
|
Senior Member |
|
|
naudefj wrote on Sun, 19 September 2010 17:09They should be removed as it's generally seen as a bad practice.
If you need this functionality, you can paste this JS code into your html:
$('a[href^="http://"]')
.attr({
target: "_blank",
title: "Opens in a new window"
});
This requires the user to have javascript enabled AND use the jquery library
(Although I always advocate that javascript is required in a modern web experience, there are still some people who have it disabled)
Ginnunga Gaming
[Updated on: Sun, 19 September 2010 15:36] Report message to a moderator
|
|
|
|
|
|
|
|
|
Re: How to disable target=_blank [message #164166 is a reply to message #164019] |
Fri, 07 January 2011 11:44 |
The Witcher
Messages: 675 Registered: May 2009 Location: USA
Karma: 3
|
Senior Member |
|
|
When this topic 1st came out I did not quite understand it, but I believe I do now. Seems that whenever I follow a link from the forum it's a pain to get back to it because the computer wants to resend the data, I much preferred the old open new window/tab functionality.
To recap, in order to fix this insert:
$('a[href^="http://"]')
.attr({
target: "_blank",
title: "Opens in a new window"
});
Into the /js/lib.js file, right after :
Which is located right around line 437 which means add the code on line 438.
I believe if possible this should be a selectable option for future releases if not default!
"I'm a Witcher, I solve human problems; not always using a sword!"
|
|
|
|
|
|
Re: How to disable target=_blank [message #164190 is a reply to message #164181] |
Sat, 08 January 2011 11:30 |
The Witcher
Messages: 675 Registered: May 2009 Location: USA
Karma: 3
|
Senior Member |
|
|
I agree and like you I can't write code but I think I understand naudfj's point, a plug in would be easier than coding it into the software and would make it a selectable item for each admin too pick and chose, coding it takes time and effort which someone must expend (even though they don't agree with the goal), it makes the software ever more complicated and ever larger.....
Naudfj being a coder looks at it a different way than you and I do which is why so much of what he and ernesto shares is way over my head they are talking code, and I am hearing it as a user so I struggle to make sense of it. But each time I do understand a part of it I am that much more able to help myself and others.
That we have the above option is only because various users (of different knowledge levels) have taken the time to try and understand it and discuss it. And the more of that that goes on the more we will understand things.
"I'm a Witcher, I solve human problems; not always using a sword!"
|
|
|
|
|