|
|
||||||
|
||||||
| Index Link To US Private Messages Archive FAQ RSS | ||||||
| Graphics & Design Discussion Forum Post your graphics design questions/comments/ideas in here. Ask questions, post tutorials, discuss trends and best practices. Sub-forum for website accessibility and usability. |
Share Thread: & Tags
|
||||
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
I'm trying to validate a page and have got it down to one item that W3C tells me is incorrect,even though they have a tutorial that tells you how to open another browser window using it!:
target="_blank"> Is there a workaround to make this compliant other than by using the JavaScript openwindow script? Thanks. |
|
|||
|
If your trying for Strict....then no it prob wont validate, because its a depreciated tag. Probably will with Transitional though.
Cindy
__________________
Web Development Community ::: Forum ::: Library It' time for Progressive Web & IT Development! |
|
|||
|
I suggest you ignore the fact that it doesn't validate, actually.
__________________
I do stuff. |
|
|||
|
!!!!
What are your reasons? I'd like to know, 'cos if it doesn't validate I can't put the little W3C logo on my site! Really, I'd like it to validate 'cos I've put a lot of work into getting it this far and I'm someone who doesn't like to give up. But I think I probably know what you're going to say! |
|
|||
|
First, put this code in an external .js text file.
I named mine "openlinkNew.js" function externalLinks() { if (!document.getElementsByTagName) return; var anchors = document.getElementsByTagName("a"); for (var i=0; i<anchors.length; i++) { var anchor = anchors[i]; if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") anchor.target = "_blank"; } } window.onload = externalLinks; I put this in the 'head': <script src="/assets/skripts/openlinkNew.js" type="text/javascript"></script> And I call the javascript by adding - rel="external" - to the links that I want to open in a new window like this: <a href="http://attitude-emedia.com/index.html" rel="external" title="Graphic and Web design"> I got all this from an article on sitepoint.com, but I can't locate it. My site validates, you can go to it and click the W3C buttons to double check. I am checking out some code to put around the javascript tags that will allow XML validation, and maybe xhtml 2.0? It is good for 1.0 strict, though. |
|
|||
|
Below is the code I use & I validate in XHTML. You can either chose to set the parameters as I have of the opening window, or not, its up to you. Though, I do suggest, that you only use parameters such as I have below for if your displaying something small. Otherwise have it open in a normal size window.
LINK Cindy
__________________
Web Development Community ::: Forum ::: Library It' time for Progressive Web & IT Development! |
|
|||
|
My point was that the only reason you're trying to get it to validate is so you can have the little icon on your site. That's all well and good, but you're hurting site functionality to make that happen. The W3C isn't always right. The target attribute has been deprecated in XHTML 1.0 but apparently will be restored in XHTML 2.0, because it does indeed serve a useful function.
Matauri/Mik's code solve the problem... unless the user doesn't have javascript, in which case your site breaks. The whole point of XHTML compliance is to increase accessibility, so it doesn't make any sense to purposely do actions that DECREASE accessibility in order to be compliant. At the very least, change Matauri's code to this: Code:
LINK
__________________
I do stuff. |
|
|||
|
Must try that Spice, I was going to test one of my new sites soon with my code on it, will try it with your variation.
Cindy
__________________
Web Development Community ::: Forum ::: Library It' time for Progressive Web & IT Development! |
|
|||
|
spice wrote
Quote:
How can adding * rel="external" * possibly cause a page to break? I am very curious about this, spice. Is there something I should know about? Compare: rel="external" to: onclick="window.open('blah.html','','toolbar=no,lo cation=no,scrolling=yes,directories=no, status=no,menubar=no,scrollbars=no,resizable=yes, width=600,height=640');return false" What affects the code more? Not to mention exactly reproducing the effect of "target="_blank""? |
|
|||
|
Quote:
In any event, what is the point if you are not even worried about 1.0, in being forward compatible to 2.0? |
|
|||
|
It was a toss up, but in the end, Strict won out, and I decided that accessibility was more important to me than having more windows popping open for my "challenged" users.
Admittedly, it was a drag to give up multiple windows, though not that great a sacrifice. I'm trying to learn how to develop accessible websites, without a lot of eye candy and fancy javascript. Kind of like starting at the basement and working my way up, so to speak. Not being a professional, I felt it was the best place to start now that I have my feet wet with free-flowing divisions and no tables in HTML 4.01/XHTML1.0. Of course, I already know that nobody here is interested in what I'm doing as an amateur, since it is so far removed from the type of websites I keep seeing in the 'Review My Website' forum, and our logs show that no one checks them out when I do post the urls, so I won't waste anyone's time by posting anything here, now. To my mind, the majority of those sites suck the big one, big time--all loaded down with borrowed scripts, cookies up the whazzoo, tonnes of third party advertising, keyword lists that are 500 bytes long, irrelevant content, rollover menus that suck up bandwidth and add nothing to the value of the site,... need I continue? Hardly. What surprises me most is that Webnaut is not speaking up about some of these sites. Jacob Nielsen would have a bird if he looked at half of them. If search engines rated sites on effeciency, usability and accessibility, most of these sites would be down at the bottom of the search results where they belong. So in my opinion, Fred, go with the Strict and don't have extra windows opening. Visitors can still use the back button or the backspace key to find your site again, or look in their history if it really is a site they want to return to. The web is cluttered up enough, as it is. IMHO, we need more developers publishing straight forward, simple, efficient websites that are accessible and easy for users, and not full of surprises, either in myriad windows or a burgeoning cookie tray. |
|
||||
|
Quote:
I thought Spice would know that since he is such an expert at reading javascripts
__________________
ranjan | Macromedia Certified Dreamweaver MX Developer http://www.dreamlettes.net - a dreamweaver resource http://www.ranjan.ws - got blog? http://www.total-impact.com - a web design community |
|
|||
|
Well guys, I tried my original code in Opera (as I have javascript disabled in that one for testing), and my original code didnt give me the new window. I replaced the # with the url, and it opened in same window, with it still working ok in a javascript enabled browser.
In regards to accessibility issues with new windows, I have yet to find a problem here. If your <title> tag says that you are opening a new window, there is no confusion. Once the window is open, there is no difference to any window being open. It doesnt clutter the web, and makes no difference so far in validation. If anyone can find otherwise, I would be interested in reading about it. Cindy
__________________
Web Development Community ::: Forum ::: Library It' time for Progressive Web & IT Development! |
|
|||
|
ranjan wrote(like I did also)
Quote:
I tested mine in javascript disabled, and it performed as you said, as it was planned to do. The link I have it enabled on is the 'attitude' gif, centered(except ie5x!)just above the footer - if folks want to check it out. I am using my site mostly just for learning and demonstrations so I try all sorts of stuff, espescially for testing for others. As far as the accessability of new windows, I have read about it being both confusing and difficult for some people, Confusing because many people rely on their back button to navigate, and often don't realize that a new window has openned, so they get stuck trying to retreat to the original page and also can get confused. It took me a while to understand in the very beginning. I also have read about it being just plain difficult for certain types of keyboard navigation with new windows being difficult to handle, as well as breaking the flow as far as history utilization is concerned. I am very much now of the mindset to not even bother anymore with opening pages in new windows. If my site is friendly, and useful, people will remember that and return - sometime anyways. They can always right click a link to open in new windows, and some people actually resent the new window thing being forced upon them. I want to have people feel as comfortable and taken care of as possible in order to attract them, not try 'tricks' to make them have to return to my site, or to trap them. That will only serve to anger them. Quote:
webnauts! Still more: Quote:
Okay, bedtime! (Hey, half the stuff in this post is news to me - we all learn :o) |
|
|||
|
ahhh Mik! I tend to disagree, at least in some instances. If a new page is only telling me a snippet of information,a FAQ or is a photo,etc.... I dont like that I have have lost my previous window just to view it.
You know me, I am a freak multi-tasker, waiting on windows to load each time is a pain in the butt for little bits of info. Yes I want to read 'that'...but I want to keep reading 'this' while it loads. I know you can do it right clicking to open a new window, but really...isnt it easier to just click, click, click & open as many FAQ answers as you like without going to the drama of right clicking & opening a whole new window? I believe everything has its place. It just has to be used for the right purpose. As for accessibility...as I said ;-) Quote:
A reader should pick up this description as it would with the rest of the info in that tag. So the reader would be telling the user a new window is opening. But, (and correct me if I am wrong), a reader would have no javascript enabled?, so if it operates without javascript being enabled, there shouldnt be a problem. I think the population of people that opening a new window this way would affect, would be so minor, it would be another case of 'some' people not being able to get 100% functionablity of the net. And to be honest, I know no one who has 100% functionability of the net. I find that with most things in this calibre, you have to weight up the 'fors' and 'against' to the benefits of having it. But to just open up a new window with a page because you feel like it....then NOOOO... no real purpose to it. Cindy
__________________
Web Development Community ::: Forum ::: Library It' time for Progressive Web & IT Development! |
|
|||
|
Matauri says
Quote:
Well, then. We are talking about different scenarios? I am only thinking of opening normal pages, not considering the 'snippets' and pictures angle, you see. So, I disagree that you disagree, because we both agree, agreed? I actually do with 'tips' what you have done with your FAQ's, not to mention the pictures of Red Canyon. I am beautiful when I'm angry LOL ;o* :O) |
|
|||
|
Quote:
Quote:
If your message is important, and relevant, you can always find ways to deliver it using a method that doesn't marginalize your visitors. And just what is so hard about right-clicking, anyway? It has a two-fold benefit: 1) The user 'knows' they have another window opened, and will be prepared to close it, or [Alt]-[Tab] between it and the other(s); and, 2) It reduces the likelihood of cross-browser scripting, by treating the new windows as separate, independent browser events in the cache (if I am correct in judging this to be the case; I could be dead wrong). Of course, some sites don't want you to do this because it breaks 'their' flow, and interrupts their logging of referring sites as well as tracking of click-through's. Bully for them. If they cannot make it on the merit of their own product(s) and must depend solely on click-through traffic for their revenue, they shouldn't be on the web, anyway. (More IMHO) |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
|
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 |