|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
| Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Target Depreciated?
I see that the "target" attribute of the <a> anchor tag is depreciated.
I assume there is now some CSS hook? How does one define how a particular link is to open (new window, same window, and so on...)? |
|
#2
|
||||
|
||||
|
Easiest way is to use unobtrusive JavaScript....
http://www.sitepoint.com/article/st...compliant-world http://www.sitepoint.com/article/xhtml-strict-popups Please search the forums before asking. This was asked a few days ago and is still on the first page of the HTML forums.... target opening new window.
__________________
Cheers, Jamie # mdb4u | mobile movie database | Please help to test and promote # skiFFie | Home of the 'accessibility module' for Drupal # Jamie Burns [me] Accessibility Module [drupal] # guidelines | search | wap resources | not getting help | fold to cure __________________ Let the might of your compassion arise to bring a quick end to the flowing stream of the blood and tears ..... Please hear my anguished words of truth. ![]() __________________ |
|
#3
|
|||
|
|||
|
I can't really see JS for something as simple as defining where a link goes, and many people either have JS disabled, or such linkys are blocked by pop-up blockers and so on.
JavaScript to tell the browser to open in a new window? Seems a little much unless you want a special size or no address bar and so on... Must be a CSS thing. |
|
#4
|
||||
|
||||
|
Quote:
The whole point is that if users have JavaScript disabled for whatever reason the link will still open - albeit in the same window. I could give you many example sites that use this or similar methods. It is not difficult to implement and it gives non-JavaScript a almost fully functional site. |
|
#5
|
||||
|
||||
|
Here are some other articles:
The Perfect Pop-up Accessible Pop-up Links Beware of opening links in a new window Opening new windows with JavaScript, version 1.2 Quote:
Nope. CSS is used to style web pages. Opening links in a new window/tab instead of the current one is a behavior, which is the domain of JavaScript.
__________________
Spreading knowledge, one newbie at a time. Learn CSS. | PHP includes | X/HTML Validator | CSS validator | Dynamic Site Solutions Design/program for Firefox (and/or Opera), apply fixes for IE, not the other way around. Check out my blog. |
|
#6
|
|||
|
|||
|
Quote:
I'm NOT interested in "pop-ups". I'm interested in targeting links at new browser tabs. And, Kravvitz, in the future before closing a thread, maybe you ought to ascertain why a question is being asked and why or why not it might be appropriate for the CSS thread. That you are now a Moderator is not a license to be rude. Last edited by Weekend Coder : January 20th, 2008 at 12:06 AM. |
|
#7
|
||||
|
||||
|
Quote:
The choice of the term "pop-up" for some of those was unfortunate. I suggest you read them before you complain about them. Pop-ups and links that open in new windows (via JavaScript) can have the same code, except the earlier use window.open's third argument and the latter does not. Quote:
There was no need to have two threads on this topic. I am curious as to why you thought CSS might have a way to do it. If you would like to explain, please do so in this thread. I was blunt as usual but wasn't intentionally rude. If you felt I was rude, I apologize. |
|
#8
|
||||
|
||||
|
(I think Kravvitz is just trying to do his job, cross posting is against the rules.)
Quote:
I'm against JavaScript controlling this type of behavior too. Though, for some reason I don't think the target attribute will become obsolete any time soon. But, when that time does come, it will already be supplemented by something better. It's a safe bet to continue using it unless of course your working with someone who's a bit stubborn and has to validate in strict. Also, I think Kravvitz is doing a fantastic job (so far) especially when he has to deal with punks like you Weekend Coder. His cockiness is pretty much the same as its always been.
__________________
Give Opera some love. Use it and you'll see why. Oh, those monkeys.::What's wrong with the world today?::The lion king in 5 seconds. My body is so sexy. |
|
#9
|
||||
|
||||
|
Hmmm.... I totally understand what W3C is trying to do with the separation of content, style, and functionality, but it just seems like this is replacing a very simple solution to a problem with a (relatively) more complex one. I suppose this is just a prime example of compliance vs practicality.
Again, I understand the logic behind the depreciation for this, but could somebody describe a practical situation where this benefits the developer or the end user?
__________________
"Nobody wins in a butter eating contest." My band, The American Autumn and on MySpace Dinosaurs Eat Everybody Team Hamster Hat .digits - Every number is the answer to something... |
|
#10
|
||||
|
||||
|
IMHO the practicality of it for developers is that they only need to include a JavaScript file in each page.
If they need to make changes on the functionality of how a window (at least for external sites) opens then only need to amend the JS file, not all the links associated with link type. I could use my site as an example. I have 2 window opening JS functions: 1) bookmarking utility (pop-up 2) external sites (new window or tab) For my pop-up links I have added rel="bookmark" For my external links, the JS file auto-magically adds rel="nofollow" class="ext" If I wanted to change my pop-up parameters to a bigger window for example, I just edit the JavaScript file - not the page with the links in it. Doing things this way has the same value, to me at least, in putting all your styling in a style sheet and not embedding it within the actual HTML. Last edited by jabba_29 : January 23rd, 2008 at 03:33 AM. |
![]() |
| Viewing: Dev Shed Forums > Web Design > HTML Programming > Target Depreciated? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|