Re: [WSG] standards or confusion?
Lachlan,I'm going to take your much appreciated response one bit at a time.By doing as you suggested, I lose the point of having used the JS in the first place.(For the purposes of this discussion, let's assume that having the copyright notices reflect the current year is a desired thing).With the JS all copyright notices are automaticaly updated when the year changes, with your method I would have to go back to each site and manualy change them.This is sort of the contrary to one of the reasons for seperating structure from presentation in the "why CSS is good" argument.BobThis one all alone on the page, with no linked JS in the head: div id="copy" script type="text/_javascript_" var d=new Date(); yr=d.getFullYear(); if (yr!=2003) document.write("copy; "+yr); /scriptnbsp;Cedar Tree Books /div p id="copy"© 2005 Cedar Tree Books/p No script (or entity reference) required.
Re: [WSG] standards or confusion?
I suppose you mean PHP or ASP or similar? If so, wouldn't this be taking things to an extreme just to do a simple copyright that is already handled so well with this little JS? Bob Javascript is for behaviour, not content (or structure, really). Therefore, if you want to dynamically change a year like that, it SHOULD be enshrined in markup (which means static or server-side processing). On 12/7/05, Bob Schwartz [EMAIL PROTECTED] wrote: Lachlan, I'm going to take your much appreciated response one bit at a time. By doing as you suggested, I lose the point of having used the JS in the first place. (For the purposes of this discussion, let's assume that having the copyright notices reflect the current year is a desired thing). With the JS all copyright notices are automaticaly updated when the year changes, with your method I would have to go back to each site and manualy change them. This is sort of the contrary to one of the reasons for seperating structure from presentation in the why CSS is good argument. Bob This one all alone on the page, with no linked JS in the head: div id=copy script type=text/javascript var d=new Date(); yr=d.getFullYear(); if (yr!=2003) document.write(copy; +yr); /scriptnbsp;Cedar Tree Books /div p id=copy(c) 2005 Cedar Tree Books/p No script (or entity reference) required. -- Joshua Street http://www.joahua.com/ +61 (0) 425 808 469 ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help ** ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help **
Re: [WSG] standards or confusion?
Bob Schwartz wrote: This one all alone on the page, with no linked JS in the head: div id=copy script type=text/javascript ... document.write(copy; +yr); /scriptnbsp;Cedar Tree Books /div p id=copy© 2005 Cedar Tree Books/p No script (or entity reference) required. I'm going to take your much appreciated response one bit at a time. By doing as you suggested, I lose the point of having used the JS in the first place. I realise that, but by using javascript to output content, you're not really separating the layers. You could use a server side script to generate it or simply use a serve side include file in all your pages, where you would only have to update it once. If you really want the client side script, you could do something like this: p id=copy© Cedar Tree Books/p var txtCopy = document.getElementById(copy).childNodes.item(0); var year = (new Date()).getFullYear(); txtCopy.replaceData(1, 0, + year); -- Lachlan Hunt http://lachy.id.au/ ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help **
Re: [WSG] standards or confusion?
Bob, on Tuesday, December 6, 2005 at 18:57 wsg@webstandardsgroup.org wrote: These connected to a linked JS in the head: 1. a href=http://www.fotografics.it; onclick=popUp (this.href,'elastic',500,650);return false;nbsp;powered by: FotoGrafics/a a href=http://www.fotografics.it; rel=popUp(type=elastic;width=500;height=650)nbsp;powered by: FotoGrafics/a In an external JavaScript: var links = document.getElementsByTagName(a); for(var i=0; ilinks.length;i++) { if(links[i].getAttribute(rel)) { var relation = getRelation(links[i]); var params = getParams(links[i]); switch(relation) { case 'popUp': links[i].onclick = new Function(return !popUp('+links[i].getAttribute(href)+','+params['type']+','+params['width']+','+params['height']+');); links[i].setAttribute(title,Link opens new window); break; } } } function getRelation(obj) { var rel=obj.getAttribute(rel); if(!rel)return false; return rel.indexOf(()==-1?rel:rel.substring(0,rel.indexOf(()); } function getParams(obj) { var rel=obj.getAttribute(rel); if(!rel)return false; if(rel.indexOf(()==-1||rel.indexOf())==-1) return []; var pliste = rel.substring(rel.indexOf(()+1,rel.indexOf())) var result = []; var parameter = pliste.split(;); for(var i=0;iparameter.length;i++) { var nameValue = parameter[i].split(=); result[nameValue[0]]=nameValue[1]; } return result; } This isn't perfect, but at least a start. Probably it is better to use the class attribute. The rest could also be done simpler and faster... I'm far from being a JavaScript-Guru ;-) 2. div id=homea href=# tabindex=1 onfocus=P7_trigNV ('p7NVim10') onblur=P7_trigNV() onmouseover=P7_trigNV ('p7NVim10') onmouseout=P7_trigNV()img src=as/im/v2_01.jpg alt= width=88 height=25 id=p7NVim10 //a/div Do you have a page where we can see what should happen? 3. body onload=P7_setNV('p7NVim10',2);P7_trigNV() http://www.quirksmode.org/blog/archives/2005/10/_and_the_winner_1.html But with all the comments... Then: addEvent(body,'load',function() { P7_setNV('p7NVim10',2) }); addEvent(body,'load',P7_trigNV); This one all alone on the page, with no linked JS in the head: div id=copy script type=text/javascript var d=new Date(); yr=d.getFullYear(); if (yr!=2003) document.write(copy; +yr); /scriptnbsp;Cedar Tree Books /div Do it on the serverside!!! regards Martin ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help **
Re: [WSG] standards or confusion?
Martin Heiden wrote: Do it on the serverside!!! Maybe I'm a cycle head, but it seems silly to use computation cycles (although very little) to compute a year that changes only once per year. Use a server side include or hard code it in your footer template and remember to change it in the new year. Guess this is my enterprise application architecture brain talking here. .Peter -- Peter J. Farrell :: Maestro Publishing http://blog.maestropublishing.com Rooibos Generator - Version 2.1 Create boilerplate beans and transfer objects for ColdFusion for free! http://rooibos.maestropublishing.com/ - Member Team Mach-II - Member Team Fusion! ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help **
Re: [WSG] standards or confusion?
Peter J. Farrell wrote: Martin Heiden wrote: Do it on the serverside!!! Maybe I'm a cycle head, but it seems silly to use computation cycles (although very little) to compute a year that changes only once per year. Use a server side include or hard code it in your footer template and remember to change it in the new year. Guess this is my enterprise application architecture brain talking here. .Peter To me the real problem with this example is that by entering the copyright year into the document using JavaScript, you are letting the user decide which year your document is copyrighted in. If the user's machine time is not set correctly, your copyright date will reflect whatever year the time is set to. I realize that very few people have their clocks set so far off that this will be a major problem, but, it is important to keep in mind that JavaScript is a client side language and you need to be aware that changes in the client machine's environment will affect the document they see when you are using JavaScript to generate content based on the user environment. For things like copyright notices, I agree with Peter that they should be generated server side, or hard coded into the page. However, I think the point of Bob's example, is to ask the question: How should I write the JavaScript if I have an item in one or more pages that changes dynamically with time or with each page load? I think Lachlans answer is that strict separation of behavior and content creates a better structure for the page that is easier to create and maintain. I personally feel that moving a single line of JavaScript to a separate file is pushing this paradigm too far. However, putting a single line of JavaScript in every link on a page would have the same effect as in-lining all your CSS. If you ever have to make a change to the page, you will be searching through the content to find all those single JavaScript line rather than looking in one file for a place to change them. Carl. ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help **
Re: [WSG] standards or confusion?
I'm no Lawyer but what are the legal ramifications of a user having the wrong year set on the client. If the client's clock were set to 1900 then wouldn't the Copyright notice then be invalid? That is one of the ramifications of not Using PHP or ASP. Stephen Bob Schwartz wrote: Lachlan, I'm going to take your much appreciated response one bit at a time. By doing as you suggested, I lose the point of having used the JS in the first place. (For the purposes of this discussion, let's assume that having the copyright notices reflect the current year is a desired thing). With the JS all copyright notices are automaticaly updated when the year changes, with your method I would have to go back to each site and manualy change them. This is sort of the contrary to one of the reasons for seperating structure from presentation in the why CSS is good argument. Bob This one all alone on the page, with no linked JS in the head: div id=copy script type=text/javascript var d=new Date(); yr=d.getFullYear(); if (yr!=2003) document.write(copy; +yr); /scriptnbsp;Cedar Tree Books /div p id=copy© 2005 Cedar Tree Books/p No script (or entity reference) required. ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help **
Re: [WSG] standards or confusion?
Peter, on Wednesday, December 7, 2005 at 12:31 wsg@webstandardsgroup.org wrote: Martin Heiden wrote: Do it on the serverside!!! Maybe I'm a cycle head, but it seems silly to use computation cycles (although very little) to compute a year that changes only once per year. Use a server side include or hard code it in your footer template and remember to change it in the new year. Guess this is my enterprise application architecture brain talking here. You're right! I would do it with SSI or even more static (maybe by using a Dreamweaver library element). As others mentioned, the solution via JavaScript relies on a correct set clock at the client's side and you can't control that. So best practice is: don't trust in it! If one uses JavaScript, one should always ask, what happens if JavaScript is disabled? What happens if anything the script relies on, is different from the expectation? The site should be usable even if the scripts aren't executed. So if it is possible to do something at the serverside or even before the upload ;-). It should be done there! And if you have a wonderful behaviour which only works on the clientside, make the site work without it, or at least give the user a message that without JavaScript he'll miss something marvelous... An Example: On our site we've got an online-consultation tool which only works with JavaScript enabled. At the moment we are redoing the site and after the relaunch this tool will be started via click on an image button. On window.onload an unobstrusive JavaScript will exchange a button which links to a contact form, with the one to start the online-consultation tool. So a user without JavaScript can use the contact form and the one with JavaScript enabled has the chance to contact us by chat. ( Of course there is another link to the contact form ;-) ) And that's the magic: You're site looks well and is usable even without JavaScript, but the scripts are able to enhance the functionality and the usability of web pages without making them unusable if the scripts aren't executed. regards Martin ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help **
Re: [WSG] standards or confusion?
Martin Heiden wrote: Peter, on Wednesday, December 7, 2005 at 12:31 wsg@webstandardsgroup.org wrote: Maybe I'm a cycle head, but it seems silly to use computation cycles (although very little) to compute a year that changes only once per year. Use a server side include or hard code it in your footer template and remember to change it in the new year. Guess this is my enterprise application architecture brain talking here. You're right! I would do it with SSI or even more static (maybe by using a Dreamweaver library element). As others mentioned, the solution via _javascript_ relies on a correct set clock at the client's side and you can't control that. So best practice is: don't trust in it! IIRC, copyrights are implicit in the US. The absence of a copyright notice does not necessary mean that the work is not copyrighted. A copyright notice became optional in the US in 1989. For more information, see Wikipedia: http://en.wikipedia.org/wiki/Copyright Standard Disclaimer: I'm not a lawyer and the information above should not be construed as advice. If only the general public knew about it... Sorry for being OT. I rarely rely on JS at all. I have a few applications that I wrote that explicitly depend on it, but that was a requirement in the architecture process and it is clear to our customers that use it (it's not a public facing website). .Peter -- Peter J. Farrell :: Maestro Publishing http://blog.maestropublishing.com Rooibos Generator - Version 2.1 Create boilerplate beans and transfer objects for ColdFusion for free! http://rooibos.maestropublishing.com/ - Member Team Mach-II - Member Team Fusion!
Re: [WSG] standards or confusion?
Lachain, I sort of get it but... Below are a couple of real world (my world, anyway) javascripts, could you re-do them as per Good, then I would have an example for reference that I could closely relate to. These connected to a linked JS in the head: 1. a href=http://www.fotografics.it; onclick=popUp (this.href,'elastic',500,650);return false;nbsp;powered by: FotoGrafics/a 2. div id=homea href=# tabindex=1 onfocus=P7_trigNV ('p7NVim10') onblur=P7_trigNV() onmouseover=P7_trigNV ('p7NVim10') onmouseout=P7_trigNV()img src=as/im/v2_01.jpg alt= width=88 height=25 id=p7NVim10 //a/div 3. body onload=P7_setNV('p7NVim10',2);P7_trigNV() This one all alone on the page, with no linked JS in the head: div id=copy script type=text/javascript var d=new Date(); yr=d.getFullYear(); if (yr!=2003) document.write(copy; +yr); /scriptnbsp;Cedar Tree Books /div Bob Bob Schwartz wrote: Lachlan, By far, the most important issue facing beginners with regards to standards is the separation of semantics, presentation and behavioural layers into well structured, valid, non- presentational markup; CSS and javascript, respectively, and it sounds like you've already made significant steps toward these goals already. Just to be clear I've understood a concept you mention above, could you show an example of javascript used as layered, non- presentational markup and one that is not? When you mix behavioural attributes within the markup, like onclick, onmouseover, etc. or javascript: pseudo-URI schemes, that's the behavioural equivalent of including presentational attributes within your markup. Instead of using those attributes, the best practice is to attach event listeners dynamically instead. For example: Bad: a href=javascript:myPopup('foo.html');evil popup/a Better: a href=foo.html onclick=myPopup(this.href);return false;not- so-evil popup/a Good: a href=foo.html id=fooNot an evil popup/a script src=popup.js type=text/javasript document.getElementById(foo).addEventListener(click, myPopup, false); or document.getElementById(foo).onclick = myPopup; Note: IMHO, all popups are evil and intrusive and must not be used under any circumstances, but this is an illustration of how to make them a little more accessible by separating the behaviour layer from the markup layer. For a better explanation and other techniques, see: http://www.onlinetools.org/articles/unobtrusivejavascript/ -- Lachlan Hunt http://lachy.id.au/ ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help ** ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help **
Re: [WSG] standards or confusion?
Bob Schwartz wrote: Below are a couple of real world (my world, anyway) javascripts, could you re-do them as per Good, then I would have an example for reference that I could closely relate to. These connected to a linked JS in the head: 1. a href=http://www.fotografics.it; onclick=popUp(this.href,'elastic',500,650);return false;nbsp;powered by: FotoGrafics/a The most unobtrusive version of this one is simply: a href=http://www.fotografics.it;powered by: FotoGrafics/a No script required. You won't get a new window for most users, only for those that explicitly request it themselves. Otherwise, try this article: http://www.alistapart.com/articles/popuplinks/ 2. div id=homea href=# tabindex=1 onfocus=P7_trigNV('p7NVim10') onblur=P7_trigNV() onmouseover=P7_trigNV('p7NVim10') onmouseout=P7_trigNV()img src=as/im/v2_01.jpg alt= width=88 height=25 id=p7NVim10 //a/div Those function names suggest that this was generated with a WYSIWYG editor. That's never a good idea. It depends on the purpose of the functions, but if they're simply changing presentational issues (which is what they're commonly used for), you could use a:hover and a:focus pseudo-classes in CSS to style them. If not, then you need to find a way to access the a element (either using a class, an id or some other method and then attach the methods. var a = ... // get the element. a.addEventListener(focus, P7_trigNV, false); (make sure you omit the parenthesis from the end of the function name. don't use P7_trigNV(), it won't work as exptected) Unfortunately, that won't work in IE unless you use a DOM 2 patch script to add support for it like I do, but the script I wrote and use isn't quite ready, as it still suffers from memory leaks and a few other small limitations. a.focus = P7_trigNV; works in all browsers, you can use that instead. You shouldn't need to pass the id of the image to the function, you have access to the a element from the event handler, so you just need to get it's child image element. Since I'm guessing all this function actually does is swap the image, you don't need JS, just use CSS image rollovers. There's many techniques available, try google. 3. body onload=P7_setNV('p7NVim10',2);P7_trigNV() function init() { P7_setNV('p7NVim10',2); P7_trigNV() } Then use either of these to attach it: document.addEventListener(load, init(), false); (won't work in IE or firefox without a patch) or window.onload = init; (non-standard, but widely supported. Limited to a single function.) You could also look up the addEvent() script. This one all alone on the page, with no linked JS in the head: div id=copy script type=text/javascript var d=new Date(); yr=d.getFullYear(); if (yr!=2003) document.write(copy; +yr); /scriptnbsp;Cedar Tree Books /div p id=copy© 2005 Cedar Tree Books/p No script (or entity reference) required. -- Lachlan Hunt http://lachy.id.au/ ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help **
Re: [WSG] standards or confusion?
Exactly where in my posts did I say I create web sites in the style of my friend? On 12/4/05, Bob Schwartz [EMAIL PROTECTED] wrote: None of those. I just mentioned that I was unable to convice my friend to change his ways and his strongest reason not to was his (fairly complicated) site that worked just fine in a lot of browsers which he built without jumping through any of the hoops I go through trying to get a complicated layout to work in as many browsers. I'm all for standards and everything else this list is about, but I do feel we might be spending a lot of time preparing for a State Dinner when what we are really going to attend is a come-as-you- are BBQ in the backyard. If it's HTML 2.0 I assume it's got numerous font tags mixed in with the multiple nested tables. I guess you and you're friend only create web sites as a once of service and don't maintain them for your clients because maintaining tag soup is not fun and that is the biggest advantage of CSS and tableless layouts. Sure when you first start out creating tableless layouts they take a while, but it gets easier and faster the more you do it - probably like when you first learn how to design layouts using tables. -- Ben Wong e: [EMAIL PROTECTED] w: http://blog.onehero.net ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help ** ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help **
Re: [WSG] standards or confusion?
Sorry, if it seemed like I implied that, but even if you don't, just the experience of the pain of having to maintain that sort of code would eliminate any thought of reverting to the old school way of making web sites. On 12/5/05, Bob Schwartz [EMAIL PROTECTED] wrote: Exactly where in my posts did I say I create web sites in the style of my friend? On 12/4/05, Bob Schwartz [EMAIL PROTECTED] wrote: None of those. I just mentioned that I was unable to convice my friend to change his ways and his strongest reason not to was his (fairly complicated) site that worked just fine in a lot of browsers which he built without jumping through any of the hoops I go through trying to get a complicated layout to work in as many browsers. I'm all for standards and everything else this list is about, but I do feel we might be spending a lot of time preparing for a State Dinner when what we are really going to attend is a come-as-you- are BBQ in the backyard. If it's HTML 2.0 I assume it's got numerous font tags mixed in with the multiple nested tables. I guess you and you're friend only create web sites as a once of service and don't maintain them for your clients because maintaining tag soup is not fun and that is the biggest advantage of CSS and tableless layouts. Sure when you first start out creating tableless layouts they take a while, but it gets easier and faster the more you do it - probably like when you first learn how to design layouts using tables. -- Ben Wong e: [EMAIL PROTECTED] w: http://blog.onehero.net ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help ** ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help ** -- Ben Wong e: [EMAIL PROTECTED] w: http://blog.onehero.net ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help **
Re: [WSG] standards or confusion?
No problem, Ben. Believe me I would never revert to the old way. I guess I was just surprised to see how well my friend's site worked in 7 or 8 different MAC win browsers with such outdated code. Sorry, if it seemed like I implied that, but even if you don't, just the experience of the pain of having to maintain that sort of code would eliminate any thought of reverting to the old school way of making web sites. On 12/5/05, Bob Schwartz [EMAIL PROTECTED] wrote: Exactly where in my posts did I say I create web sites in the style of my friend? On 12/4/05, Bob Schwartz [EMAIL PROTECTED] wrote: None of those. I just mentioned that I was unable to convice my friend to change his ways and his strongest reason not to was his (fairly complicated) site that worked just fine in a lot of browsers which he built without jumping through any of the hoops I go through trying to get a complicated layout to work in as many browsers. I'm all for standards and everything else this list is about, but I do feel we might be spending a lot of time preparing for a State Dinner when what we are really going to attend is a come-as-you- are BBQ in the backyard. If it's HTML 2.0 I assume it's got numerous font tags mixed in with the multiple nested tables. I guess you and you're friend only create web sites as a once of service and don't maintain them for your clients because maintaining tag soup is not fun and that is the biggest advantage of CSS and tableless layouts. Sure when you first start out creating tableless layouts they take a while, but it gets easier and faster the more you do it - probably like when you first learn how to design layouts using tables. -- Ben Wong e: [EMAIL PROTECTED] w: http://blog.onehero.net ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help ** ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help ** -- Ben Wong e: [EMAIL PROTECTED] w: http://blog.onehero.net ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help ** ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help **
Re: [WSG] standards or confusion?
Christian Montoya wrote: Tables + tag soup = hacking. Your friend really needs to get with it. Validation is not the main issue, it's accessibility. Speed is important too. If you can convince him to use CSS (if you can't, you have a lot to learn too, or he is dumb) then he will want to get browsers out of quirks mode, since that is where the real differences show. Then he will have to have a doctype, to make sure that browsers (mostly) follow the rules. I've had the unfortunately task of educating vendors (usually some form of CMS/DMS) in this area, and some are definitely more resistant to this than others. Mentioning the speed gains and legal backing now behind accessibility law only seems to get some vendors ingrained into a defence of their own workflow models, though. Apart from that, I second everything Christian said ;) Lawrence -- Lawrence Meckan Absalom Media Mob: (04) 1047 9633 ABN: 49 286 495 792 http://www.absalom.biz ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help **
Re: [WSG] standards or confusion?
Lachlan, By far, the most important issue facing beginners with regards to standards is the separation of semantics, presentation and behavioural layers into well structured, valid, non-presentational markup; CSS and javascript, respectively, and it sounds like you've already made significant steps toward these goals already. Just to be clear I've understood a concept you mention above, could you show an example of javascript used as layered, non-presentational markup and one that is not? thanks, bob ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help **
Re: [WSG] standards or confusion?
On 05/12/05, Bob Schwartz [EMAIL PROTECTED] wrote: Just to be clear I've understood a concept you mention above, could you show an example of javascript used as layered, non-presentational markup and one that is not? a) a href=javascript:myfunction();Link/a b) a href=page.html onclick=myfunction(); return false;Link/a c) a href=page.html class=javascript_hookLink/a a) is hideous b) is better but still mixes structure and behaviour c) where you will use, for example, the class attribute to add events on runtime, is optimal and non-intrusive See http://www.onlinetools.org/articles/unobtrusivejavascript/ -- Manuel a veces :) a veces :( pero siempre trabajando duro para Simplelógica: apariencia, experiencia y comunicación en la web. http://simplelogica.net # (+34) 985 22 12 65 ¡Ah! y escribiendo en Logicola: http://logicola.simplelogica.net ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help **
Re: [WSG] standards or confusion?
Bob Schwartz wrote: Lachlan, By far, the most important issue facing beginners with regards to standards is the separation of semantics, presentation and behavioural layers into well structured, valid, non-presentational markup; CSS and javascript, respectively, and it sounds like you've already made significant steps toward these goals already. Just to be clear I've understood a concept you mention above, could you show an example of javascript used as layered, non-presentational markup and one that is not? When you mix behavioural attributes within the markup, like onclick, onmouseover, etc. or javascript: pseudo-URI schemes, that's the behavioural equivalent of including presentational attributes within your markup. Instead of using those attributes, the best practice is to attach event listeners dynamically instead. For example: Bad: a href=javascript:myPopup('foo.html');evil popup/a Better: a href=foo.html onclick=myPopup(this.href);return false;not-so-evil popup/a Good: a href=foo.html id=fooNot an evil popup/a script src=popup.js type=text/javasript document.getElementById(foo).addEventListener(click, myPopup, false); or document.getElementById(foo).onclick = myPopup; Note: IMHO, all popups are evil and intrusive and must not be used under any circumstances, but this is an illustration of how to make them a little more accessible by separating the behaviour layer from the markup layer. For a better explanation and other techniques, see: http://www.onlinetools.org/articles/unobtrusivejavascript/ -- Lachlan Hunt http://lachy.id.au/ ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help **
[WSG] standards or confusion?
Just over a year ago, I decided to improve my knowledge of CSS, which (although I'd been using it for a few years) seemed a good idea. I joined the CSS list, then this one, I read Jeffrey Zeldman (and a lot of web sites about standards) and everything was rosy in the garden. Of course, I had to overcome the obstacle of thinking in terms of content/presentation and doing away with tables etc, but once I'd got through the trauma of floats etc it all made sense. I imagine that's much the same for all of us. However, just lately (a few months maybe) there has been an increasing number of folk arguing about xhtml and xml and mime types and oh dear dear, headaches all around. The result? I now feel totally confused (I admit I don't really understand all that mime stuff - yet) but more importantly, my confidence has gone. Since Zeldman (and lots of others) told me it was a good idea to write xhml strict I've done exactly that - every site I've done in the last year has been done in xhtml strict. I did it because people were telling me that it was a good thing, so that what I've done was easily portable later on. So have I done a daft thing? I really don't know! I'm absolutely positive I'm not alone in feeling this insecurity and, on the face of it, Lachlan may well have a point about newcomers keeping it simple at first. What I do know is that, like T.R.Valentine, I do wish someone could tell me [definitively] how this xhtml should be presented/marked up so I can feel a bit happier again . . . Just thinking out loud, and emnot/em wanting a mass of mails from different camps all claiming different things are the 'right' answer. -- Best Regards, Bob McClelland Cornwall (UK) www.gwelanmor-internet.co.uk ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help **
Re: [WSG] standards or confusion?
Oddly enough I've been thinking about making a similar post. I would have said all you said and then added two more tidbits. 1. Just read on some blog (pointed to from this list) where doctypes are useful only for validation, otherwise of no use. 2. A friend just got back into the web design game after a long time away. He sent me his site: pure HTML 2.0, no doctype lots of tables and the usual tag soup. I mentioned to him that things had changed and he should get with the modern way of doing things. To his various questions as to why, I gave all the right answers, but in the end he said if it works, why change? I viewed his site in all my various MAC WIN browsers, it worked just fine in all of them. Bob Just over a year ago, I decided to improve my knowledge of CSS, which (although I'd been using it for a few years) seemed a good idea. I joined the CSS list, then this one, I read Jeffrey Zeldman (and a lot of web sites about standards) and everything was rosy in the garden. Of course, I had to overcome the obstacle of thinking in terms of content/presentation and doing away with tables etc, but once I'd got through the trauma of floats etc it all made sense. I imagine that's much the same for all of us. However, just lately (a few months maybe) there has been an increasing number of folk arguing about xhtml and xml and mime types and oh dear dear, headaches all around. The result? I now feel totally confused (I admit I don't really understand all that mime stuff - yet) but more importantly, my confidence has gone. Since Zeldman (and lots of others) told me it was a good idea to write xhml strict I've done exactly that - every site I've done in the last year has been done in xhtml strict. I did it because people were telling me that it was a good thing, so that what I've done was easily portable later on. So have I done a daft thing? I really don't know! I'm absolutely positive I'm not alone in feeling this insecurity and, on the face of it, Lachlan may well have a point about newcomers keeping it simple at first. What I do know is that, like T.R.Valentine, I do wish someone could tell me [definitively] how this xhtml should be presented/marked up so I can feel a bit happier again . . . Just thinking out loud, and emnot/em wanting a mass of mails from different camps all claiming different things are the 'right' answer. -- Best Regards, Bob McClelland Cornwall (UK) www.gwelanmor-internet.co.uk ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help ** ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help **
Re: [WSG] standards or confusion?
On 04/12/05, designer [EMAIL PROTECTED] wrote: Hi Bob, please understand any blunt or straightforward response is by no means a personal attack on you, but I feel the rant mode growing inside of me :-) Just over a year ago, I decided to improve my knowledge of CSS, which (although I'd been using it for a few years) seemed a good idea. I joined the CSS list, then this one, I read Jeffrey Zeldman (and a lot of web sites about standards) and everything was rosy in the garden. Of course, I had to overcome the obstacle of thinking in terms of content/presentation and doing away with tables etc, but once I'd got through the trauma of floats etc it all made sense. I imagine that's much the same for all of us. As grown-ups, I assume everybody should be aware that in life and human tasks, things ain't hardly ever rosy in the garden. The ways of the world are subtle and web design, being part of the world, has its number of subtle and complicated issues. Did you expect otherwise? That said, may I remember everybody that using for example HTML 4.01 + CSS 2.1 as standards, together with best practices as semantic markup, is well regarded all across the universe. Even people who think that XHTML is ready for prime time won't frown upon a HTML Strict DOCTYPE, methinks. Some people will frown upon XHTML Doctypes. That's because there's a theoretical discussion among us, practicioners of this craft. That's not a headache. That's a natural part of any art, craft or science. And frankly, the issues involved, whichever your take, are not really that hard to grasp. A couple of hours reading some blog posts and specs will give you a clear panorama of the problems and 'hot issues' being discussed. I find very amusing people who want to be 'future-proof' but don't want to bother with 'mime types and all that complicated stuff'. If someone really can't, or don't want to, deal with the current level of complexity, I claim she's hardly 'future-proof', because that mindset, the 'I want easy answers' mentality, is gonna crash hard with XHTML 2, XForms, etc. And sorry if you thougth that doing what guru X is doing was gonna save you from taking your own decissions or doing your homework. It doesn't work this way, never has and never will. Zeldman can't take you from the hand all the time. No one can. Some I won't tell you which option is better. I'm just warning you that complaining yourself away from the learning process isn't gonna work. Good web design is beautiful, but it's hard. The more the possibilities grow, the higher the complexity of the tasks. It happens with everything. It's up to the individual to consider if it's worth the effort or a career shift is in order :-) Thanks for putting up with my rant. Excuse my english (I hope it's at least comprehensible) -- Manuel a veces :) a veces :( pero siempre trabajando duro para Simplelógica: apariencia, experiencia y comunicación en la web. http://simplelogica.net # (+34) 985 22 12 65 ¡Ah! y escribiendo en Logicola: http://logicola.simplelogica.net ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help **
Re: [WSG] standards or confusion?
On 04/12/05, Bob Schwartz [EMAIL PROTECTED] wrote: 2. A friend just got back into the web design game after a long time away. He sent me his site: pure HTML 2.0, no doctype lots of tables and the usual tag soup. I mentioned to him that things had changed and he should get with the modern way of doing things. To his various questions as to why, I gave all the right answers, but in the end he said if it works, why change? I viewed his site in all my various MAC WIN browsers, it worked just fine in all of them. Are you asking for the benefits of standards-based design or the ROI of it? It's on like 100 trillions of documents and books written since 2001. Give him a Zeldman or Cederholm book for Christmas :-) -- Manuel a veces :) a veces :( pero siempre trabajando duro para Simplelógica: apariencia, experiencia y comunicación en la web. http://simplelogica.net # (+34) 985 22 12 65 ¡Ah! y escribiendo en Logicola: http://logicola.simplelogica.net ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help **
Re: [WSG] standards or confusion?
None of those. I just mentioned that I was unable to convice my friend to change his ways and his strongest reason not to was his (fairly complicated) site that worked just fine in a lot of browsers which he built without jumping through any of the hoops I go through trying to get a complicated layout to work in as many browsers. I'm all for standards and everything else this list is about, but I do feel we might be spending a lot of time preparing for a State Dinner when what we are really going to attend is a come-as-you- are BBQ in the backyard. On 04/12/05, Bob Schwartz [EMAIL PROTECTED] wrote: 2. A friend just got back into the web design game after a long time away. He sent me his site: pure HTML 2.0, no doctype lots of tables and the usual tag soup. I mentioned to him that things had changed and he should get with the modern way of doing things. To his various questions as to why, I gave all the right answers, but in the end he said if it works, why change? I viewed his site in all my various MAC WIN browsers, it worked just fine in all of them. Are you asking for the benefits of standards-based design or the ROI of it? It's on like 100 trillions of documents and books written since 2001. Give him a Zeldman or Cederholm book for Christmas :-) -- Manuel a veces :) a veces :( pero siempre trabajando duro para Simplelógica: apariencia, experiencia y comunicación en la web. http://simplelogica.net # (+34) 985 22 12 65 ¡Ah! y escribiendo en Logicola: http://logicola.simplelogica.net ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help ** ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help **
Re: [WSG] standards or confusion?
designer wrote: Just over a year ago, I decided to improve my knowledge of CSS, which (although I'd been using it for a few years) seemed a good idea. Yes, that is a very good idea. I joined the CSS list, then this one, I read Jeffrey Zeldman (and a lot of web sites about standards) and everything was rosy in the garden. Of course, I had to overcome the obstacle of thinking in terms of content/presentation and doing away with tables etc, but once I'd got through the trauma of floats etc it all made sense. I imagine that's much the same for all of us. Yes, we all face those obstacles to begin with and you've done well to get this far already. However, just lately (a few months maybe) there has been an increasing number of folk arguing about xhtml and xml and mime types and oh dear dear, headaches all around. The result? I now feel totally confused Confusion amongst beginners about all of these issues is one of the primary reasons why XHTML is not suitable for beginners, because an understanding of them is required to be learnt by anyone attempting to use XHTML. However, the biggest problem is not that XHTML is complicated, anyone can learn it if they put in the effort, it's that those of teaching the beginners are not united on the issue. With different information coming at you from all different sides, there is no wonder you are confused by it all. (I admit I don't really understand all that mime stuff - yet) but more importantly, my confidence has gone. It's important that you don't lose your confidence, as I said you've done extremely well to get where you are and you should be proud of yourself and your efforts. By far, the most important issue facing beginners with regards to standards is the separation of semantics, presentation and behavioural layers into well structured, valid, non-presentational markup; CSS and javascript, respectively, and it sounds like you've already made significant steps toward these goals already. The other major issue involved, and the one we have been discussing that has resulted your confusion and lack of confidence, relates to in-depth technical issues of the medium. MIME types are perhaps one of the most confusing, as they don't seem to directly relate to how you perceive the way the web or your development tools work. I will briefly discuss them for you at the end of this e-mail. Since Zeldman (and lots of others) told me it was a good idea to write xhml strict I've done exactly that In theory, authoring in XHTML does have significant benefits over HTML. However, the information often left out by those advocating its use by beginners can have significant consequences (many of which have been discussed in recent threads). Authoring XHTML requires it be developed in an XML environment and at least tested extensively under XML conditions (even if it will eventually be served to the world as HTML). The fact is that precisely none of the purported benefits of XHTML are sustained in a purely HTML authoring environment, and that is precisely how the vast majority of beginners, including yourself, actually end up developing XHTML, simply because a) information is left out and b) as evidenced by your e-mail today, beginners cannot be expected to understand it all anyway. every site I've done in the last year has been done in xhtml strict. I did it because people were telling me that it was a good thing, so that what I've done was easily portable later on. So have I done a daft thing? I really don't know! Firstly, to be clear, I do believe XHTML is a very good thing and there are significant benefits to using it. So, people telling you to use XHTML is not necessarily a bad thing, but the problem is that you were not ready for it at the time. Given your current experience, however, you may now be ready to start learning it all. I don't think you have done a daft thing, we all need to learn some how. Whether or you not learned in the most ideal way can be, and is being, questioned; but regardless of the answer you've still learned very valuable lessons with regards to standards based development, and as I said, that is the most important thing. MIME Types As I promised, this is a (not so) brief discussion of MIME types and how they relate to this discussion of HTML vs. XHTML. Mime types are the means by which applications should determine how to handle the content they receive from the web. Despite popular misconceptions (and the behaviour of some broken web browsers in some cases), file extensions are not supposed to used by the browser to determine what to do with the file, file extensions are supposed to be meaningless in the context of the web. This may seem confusing at first because when you write an HTML file, you give it a .htm or .html extension and that seems to be how it knows what type of file it is. In many ways, this is indeed the case, but there is a
Re: [WSG] standards or confusion?
Bob Schwartz wrote: None of those. I just mentioned that I was unable to convice my friend to change his ways and his strongest reason not to was his (fairly complicated) site that worked just fine in a lot of browsers which he built without jumping through any of the hoops I go through trying to get a complicated layout to work in as many browsers. So is the core of the issue not designing with CSS vs tables, rather than with the standards themselves? -- Patrick H. Lauke __ re·dux (adj.): brought back; returned. used postpositively [latin : re-, re- + dux, leader; see duke.] www.splintered.co.uk | www.photographia.co.uk http://redux.deviantart.com __ Web Standards Project (WaSP) Accessibility Task Force http://webstandards.org/ __ ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help **
Re: [WSG] standards or confusion?
On 04/12/05, Patrick H. Lauke [EMAIL PROTECTED] wrote: So is the core of the issue not designing with CSS vs tables, rather than with the standards themselves? Yes, there's an ongoing confusion between standards compliance (validation) and observance of good practices (css layouts, etc.) -- Manuel a veces :) a veces :( pero siempre trabajando duro para Simplelógica: apariencia, experiencia y comunicación en la web. http://simplelogica.net # (+34) 985 22 12 65 ¡Ah! y escribiendo en Logicola: http://logicola.simplelogica.net ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help **
Re: [WSG] standards or confusion?
On 12/4/05, Bob Schwartz [EMAIL PROTECTED] wrote: 2. A friend just got back into the web design game after a long time away. He sent me his site: pure HTML 2.0, no doctype lots of tables and the usual tag soup. I mentioned to him that things had changed and he should get with the modern way of doing things. To his various questions as to why, I gave all the right answers, but in the end he said if it works, why change? I viewed his site in all my various MAC WIN browsers, it worked just fine in all of them. Tables + tag soup = hacking. Your friend really needs to get with it. Validation is not the main issue, it's accessibility. Speed is important too. If you can convince him to use CSS (if you can't, you have a lot to learn too, or he is dumb) then he will want to get browsers out of quirks mode, since that is where the real differences show. Then he will have to have a doctype, to make sure that browsers (mostly) follow the rules. -- -- Christian Montoya christianmontoya.com ... rdpdesign.com ... cssliquid.com ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help **
Re: [WSG] standards or confusion?
My biggest reason for following standards originally was selfish: vastly increased ease of maintainability. When you separate content from presentation, you can change the presentation aspect of the site once and it goes into effect across the entire site. I really, really liked that aspect of it. Pages load faster thanks to smaller file sizes, and site visitors notice that. There are other benefits, but those were what convinced me. Leslie Riggs None of those. I just mentioned that I was unable to convice my friend to change his ways and his strongest reason not to was his (fairly complicated) site that worked just fine in a lot of browsers which he built without jumping through any of the hoops I go through trying to get a complicated layout to work in as many browsers. I'm all for standards and everything else this list is about, but I do feel we might be spending a lot of time preparing for a State Dinner when what we are really going to attend is a come-as-you- are BBQ in the backyard. On 04/12/05, Bob Schwartz [EMAIL PROTECTED] wrote: 2. A friend just got back into the web design game after a long time away. He sent me his site: pure HTML 2.0, no doctype lots of tables and the usual tag soup. I mentioned to him that things had changed and he should get with the modern way of doing things. To his various questions as to why, I gave all the right answers, but in the end he said if it works, why change? I viewed his site in all my various MAC WIN browsers, it worked just fine in all of them. Are you asking for the benefits of standards-based design or the ROI of it? It's on like 100 trillions of documents and books written since 2001. Give him a Zeldman or Cederholm book for Christmas :-) -- Manuel a veces :) a veces :( pero siempre trabajando duro para Simplelógica: apariencia, experiencia y comunicación en la web. http://simplelogica.net # (+34) 985 22 12 65 ¡Ah! y escribiendo en Logicola: http://logicola.simplelogica.net ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help ** ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help ** ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help **
Re: [WSG] standards or confusion?
Hi Lachlan, Lachlan Hunt wrote: [snipped] MIME Types As I promised, this is a (not so) brief discussion of MIME types and how they relate to this discussion of HTML vs. XHTML. I will certainly read and inwardly digest this! Many thanks, Best Regards, Bob McClelland Cornwall (UK) www.gwelanmor-internet.co.uk ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help **
Re: [WSG] standards or confusion?
On 12/4/05, Bob Schwartz [EMAIL PROTECTED] wrote: None of those. I just mentioned that I was unable to convice my friend to change his ways and his strongest reason not to was his (fairly complicated) site that worked just fine in a lot of browsers which he built without jumping through any of the hoops I go through trying to get a complicated layout to work in as many browsers. I'm all for standards and everything else this list is about, but I do feel we might be spending a lot of time preparing for a State Dinner when what we are really going to attend is a come-as-you- are BBQ in the backyard. If it's HTML 2.0 I assume it's got numerous font tags mixed in with the multiple nested tables. I guess you and you're friend only create web sites as a once of service and don't maintain them for your clients because maintaining tag soup is not fun and that is the biggest advantage of CSS and tableless layouts. Sure when you first start out creating tableless layouts they take a while, but it gets easier and faster the more you do it - probably like when you first learn how to design layouts using tables. -- Ben Wong e: [EMAIL PROTECTED] w: http://blog.onehero.net ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help **