|
|
||||||
|
||||||
| Index Link To US Private Messages Archive FAQ RSS | ||||||
| Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome. |
Share Thread: & Tags
|
||||
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hi I will start with if this is in the wrong forum please move it to the correct one. I have been away from the programming side of this business for a while and am getting back into it WPW has changed a lot since I have been out of it you don't even have a HTML forum any more that I found anyway.
My question is this when creating a link such as <a href="link.html">Text info</a> Does using the blank tag still work only in certain browsers any more or is completely obsolete and if obsolete what is the work around. <a href="link.html" target="_blank">Text info</a> In the past I would use the blank tag to get the link count but by sending them to a new widow I would keep the fewer on my site as well. With popup blocker and tabs I am not sure about today’s environment. And you don’t know how old this makes me feel asking a simple question like this it’s only been a few years. LOL Thanks |
|
|||
|
Is it me or does it seem the new way isn't an improvement on the the old target="_blank"?
|
|
|||
|
Thanks for the help. WPW crew has alway been good for helping out.
Not a big change. |
|
|||
|
Not saying you did mate. Just commenting on the sometimes backwardness of progress.
My humblest apologies if it sounded like I was criticizing you. What I meant was that when something gets deprecated you'd expect it to be replaced by something better. |
|
||||
|
True. Really, the intent of the target attribute was for frames, when frames were removed from the spec target basically went with it. Of course, W3C reasoned this away by saying you should leave it as a user option whether or not to open the page in a new window.
__________________
The best way to learn anything, is to question everything. |
|
|||
|
Using the target attribute is generally considered a bad practice, because users can right-click the link, and chose open in a new window, if thats what they want. And i can honestly say that i agree its better to do things this way.
Using JavaScript is better, because you can do all sorts of stuff, aside from just opening the link in a new window. You can also call a function, which tracks the number of times the link was clicked, for example. Those who still use the target attribute, are really just going to annoy a large chunk of their visitors.
__________________
The Blood of the Lamb is my Breakfast. |
|
||||
|
... we're getting to the stage where it seems to be frowned upon if you design/sequence/organise/prettify/structure/define the way you'd like to present your information over the web. I think it's the xml obsession, content with no markup that becomes markup with no content, rearing its ugly head again.
target="_blank" is considered bad practice because it is trying to control the sequence and focus whilst a user accesses information. Using this same criteria, films (movies) ought to be distributed as a collection of random scenes. I'd like to see the end first, green and yellow's nice, very loud music please... and make all the characters big Last edited by Uncle Dog; 07-23-2009 at 08:33 PM. |
|
|||
|
Thats their choice, not our problem. Luckily few users are stupid enough to do something as drastic as that, because then they wouldn't be able to use facebook, youtube, or even their favorite web-mail client optimally.
Why would anyone want to use the target attribute anyway? What practical purpose dose it serve? Other then annoy users? I used it my self some years back, but that was before i started to think about the annoyances it creates for users. Browsers don't indicate when the target attribute is used, you will have to do that through a custom user-defined stylesheet, and fooling with attribute selectors. Browsers also dont have a "open in same window" link, which can be quite annoying when you encounter sites that uses the target attribute. Some designers also abuse the scripted versions, simply for the sake of customizing the look and feel of the browser. Without ever thinking about the features that they are hampering. Its generally considered good design practice, to provide alternatives to those features if you chose to remove them.
__________________
The Blood of the Lamb is my Breakfast. |
|
||||
|
Quote:
Many mobile devices have Javascript turned off by default and many of those 'stupid users' (as you like to refer to them) probably don't realise that's the case. They just see a web site that doesn't work and go elsewhere. |
|
||||
|
But, with this method if the client has Javascript disabled, execution will fall through safely - the link still works, it is just up to the user if they want to open the link in a new window/tab. In fact, it should be safer on mobile devices, which may not properly handle target.
__________________
The best way to learn anything, is to question everything. |
|
||||
|
Wige, I understand what you are saying here. I didn't look closely enough at your original example up in post #2. instead I assumed that the link itself would be to Javascript which therefore wouldn't have worked if Javascript is disabled.
Your example certainly does work if Javascript is disabled, but when Javascript is enabled the effect is not what you might expect. In both Firefox 3 and IE8 and presumably other browsers too, the Javascript opens the link in a new window and the href opens the link in the current window so you now have two windows showing the same content and the original page has disappeared. I guess you could fix this by getting the Javascript to go back to the original window and execute a 'back' command then switch back to the new window but this seems extremely clumsy and messes up the users browsing history. I can't find any evidence for your claim that this is the 'new way to open a new window'. |
|
||||
|
Yeah, I was typing fast and screwed it up. The correct code is as follows:
<a href="link.html" onclick="window.open(this);return false;">Text info</a> This code will work such that the window will open to the page specified in the href element - there is no need to even change the onclick if, for example, you someday change the link destination. Being that this is a very old, core piece of Javascript code, it should work as is in every browser that supports Javascript. I have tested it in IE6, IE7, IE8, Chrome, Opera 9, Opera 10, Firefox2, Firefox3 and Safari with Javascript enabled and disabled with no issues. Also, I wasn't claiming this was new in any way (hence the quotes) just that this is the current alternative, which is acceptable for documents using the XHTML1.0 Strict doctype.
__________________
The best way to learn anything, is to question everything. |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| PPC Basics | rfrazee | SEO 101 | 1 | 06-23-2008 04:08 PM |
| Just the basics, please! | MikeSzyszka | Flash Discussion Forum | 2 | 03-09-2005 01:38 PM |
| SEO Basics | chrison600 | Search Engine Optimization Forum | 2 | 12-21-2004 04:35 PM |
| basics | mikeyinhk | Google Discussion Forum | 1 | 09-17-2004 12:01 PM |
|
WebProWorld |
Advertise |
Contact Us |
About |
Forum Rules |
MVP's |
Archive |
Newsletter Archive |
Top |
WebProNews
WebProWorld is an iEntry, Inc. ® site - © 2009 All Rights Reserved Privacy Policy and Legal iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509 |