RE: [uf-discuss] Tutorial on AHAH (such a cool technology!)
Paul Wilkins wrote: If you mouse to the bottom right of the presentation (or press C) you'll find there are some minor controls, but you've got to either stumble upon them or know about them beforehand. What's really needed is for someone to take the S5 system and built upon it an easily discoverable system for nagivation and control, but that would mean finding someone with the time to put together the interface. heh. If I didn't have so many other projects, I'd jump on it (would be a good way to learn JS.) Maybe after I finish all my other projects... :) BTW, it seems one can press T to toggle and get a printable view. If he added visible controls it would sure be the heck out of Powerpoint for the web! Unfortunately T only switches the view from slideshow to content. The printout isn't affected from either view. Perhaps there needs to be two print stylesheets, and have them switched to match the view. Strange; S5's intro[1] DOES print correctly in outline mode, but Roger's AHAH slideshow does not. In this case finding them via the id attributes isn't viable, so the next best thing to do it limit the number of elements that need to be searched through, to help the computer do its thing more quickly than if it were using some generic getElementsByClassName function. At least some of them allow you to supply extra info to help narrow down and pleed up the search, like http://www.dustindiaz.com/getelementsbyclass That looks like a good middle ground. With the growth in class names being used for purposes other than styling, there will be in a few years more and more trouble with them clashing together. Looking at the list of class names for microformats alone, http://microformats.org/wiki/existing-classes I can see names that have been used in previous created stylesheets. I don't know if you are aware, but I made a big deal about that issue on this list several months ago but it seemed that most people didn't feel like my concerns were going to be an issue. So rather than beat a dead horse, I moved on to work in other areas. I still monitor this list occassionally, but not in real time. In light of this, my own development is going to feature a slow down in class names for attaching javascript events, and instead focus on methods that should prove to be more compatible with less troubles in the future. While it's convenient, it's slow, demanding, and at high risk of breaking. And microformats, as currently envisioned, are *not* at a high risk for breaking? They *are*are at more of a risk of breaking, but it's the best solution we have at the moment. Actually, there are solutions I've proposed I think are better, but they fell on deaf ears on this list. I can dredge them up again if you like. As an aside, rel=ahah wouldn't be at a high risk of breaking because the author using the technique would author it so it didn't break (or can you see potentials where his authoring would break that are not abstract hypotheticals?) Sure thing. Take for example the case where some webmaster decides to specify the relevance of outgoing links. He may have a script that goes through adding rel tags to certain known links and domains, and leave empty those that it doesn't know about. That example is the problem I eventually tracked down, to help someone who's attributes weren't sticking, because another script that nobody had looked much at was playing around where it shouldn't have. Well, that would break all of Microformats and sounds like the problem is the rogue webmaster not realizing that existing rel tags need to be maintained. I can see a potential for such a problem, but in the same context I can see that webmaster creating far greater problems than just upseting rel=ahah. Also, how would Diaz' article apply if these AHAH links were littered throughout the document? His article addressed what seemed like typically a single widget, not multiple instances of the same widget scattered throughout a document. The dilemma is when there are several types of widgets scattered throughout a document. Then each widget is going to be lining up behind each other, waiting for the chance to scan through and find the bits it needs. Here's a thought (more of a Javascript issue than a microformat issue; we can take offline is anyone objects): would it be possible to pipeline in a common file with a single scanner that any such widgets could attach to? (I don't know Javascript well enough to know the answer to that.) I think it would be a heavy burden to place on a content author to require them to write the Javascript code he talks about if they had to tag 10 different segments rather than just scan for a rel=ahah. I think these may well be two different use-cases that might deserve two different approaches. It would be a heavy burden, so I'm suggesting that the javascript code he talks about is
OFFLIST: Re: [uf-discuss] Tutorial on AHAH (such a cool technology!)
Paul: OFFLIST I really enjoyed your discussion, and you seem to be very knowledgable about Javascript issues. I have started a project with a partner in the UK (I am in the USA) that we hope to see grow to be used by most websites and most webusers. One thing we think is missing are visible reasons for people to use semantic markup where they can see an immediate and obvious tangible benefit. That's why we decided to pursue this project. We've got pure intentions, and our goal is to be a catalyst to make the web better. The project is called Toolicious (http://t.oolicio.us) Minimally all I'm asking is for you to read the small amount of info on the website and then give me your feedback. Beyond that I'd hope you'd just the mailing list[1] and participate in the discussions. We want to ensure that there is no reason people wouldn't want to use it on their website, but I'll let the website try to finish explaining to you as it eventually needs to speak for itself. Thanks in advance for your consideration. -- -Mike Schinkel http://www.mikeschinkel.com/blogs/ http://www.welldesignedurls.org http://atlanta-web.org - http://t.oolicio.us It never ceases to amaze how many people will proactively debate away attempts to improve the web... [1] http://lists.t.oolicio.us/toolicious-discuss/ ___ microformats-discuss mailing list microformats-discuss@microformats.org http://microformats.org/mailman/listinfo/microformats-discuss
RE: OFFLIST: Re: [uf-discuss] Tutorial on AHAH (such a cool technology!)
Oops! Oh well, nothing said that I wasn't going to present to the Microformat community eventually! -Mike -Original Message- From: Mike Schinkel [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 06, 2007 4:43 AM To: 'Microformats Discuss' Subject: OFFLIST: Re: [uf-discuss] Tutorial on AHAH (such a cool technology!) Paul: OFFLIST I really enjoyed your discussion, and you seem to be very knowledgable about Javascript issues. I have started a project with a partner in the UK (I am in the USA) that we hope to see grow to be used by most websites and most webusers. One thing we think is missing are visible reasons for people to use semantic markup where they can see an immediate and obvious tangible benefit. That's why we decided to pursue this project. We've got pure intentions, and our goal is to be a catalyst to make the web better. The project is called Toolicious (http://t.oolicio.us) Minimally all I'm asking is for you to read the small amount of info on the website and then give me your feedback. Beyond that I'd hope you'd just the mailing list[1] and participate in the discussions. We want to ensure that there is no reason people wouldn't want to use it on their website, but I'll let the website try to finish explaining to you as it eventually needs to speak for itself. Thanks in advance for your consideration. -- -Mike Schinkel http://www.mikeschinkel.com/blogs/ http://www.welldesignedurls.org http://atlanta-web.org - http://t.oolicio.us It never ceases to amaze how many people will proactively debate away attempts to improve the web... [1] http://lists.t.oolicio.us/toolicious-discuss/ ___ microformats-discuss mailing list microformats-discuss@microformats.org http://microformats.org/mailman/listinfo/microformats-discuss
Re: [uf-discuss] Tutorial on AHAH (such a cool technology!)
Mike Schinkel wrote: Strange; S5's intro[1] DOES print correctly in outline mode, but Roger's AHAH slideshow does not. Now that *is* an interesting problem. It appears that Roger uses a separate print stylesheet that forces the page break after each slide. Naughty Roger. At least some of them allow you to supply extra info to help narrow down and pleed up the search, like http://www.dustindiaz.com/getelementsbyclass That looks like a good middle ground. It is a good middle ground. Let's make the code smarter so that the job can be performed faster. I don't know if you are aware, but I made a big deal about that issue on this list several months ago but it seemed that most people didn't feel like my concerns were going to be an issue. So rather than beat a dead horse, I moved on to work in other areas. I still monitor this list occassionally, but not in real time. Well it'll be a shame to lose your voice on this, because often it is the pressure of limitations (such as trying to use less class) that give rise to the inspiration for a creative solution. They *are*are at more of a risk of breaking, but it's the best solution we have at the moment. Actually, there are solutions I've proposed I think are better, but they fell on deaf ears on this list. I can dredge them up again if you like. Oh yes please, do tell. Sure thing. Take for example the case where some webmaster decides to specify the relevance of outgoing links. He may have a script that goes through adding rel tags to certain known links and domains, and leave empty those that it doesn't know about. Well, that would break all of Microformats and sounds like the problem is the rogue webmaster not realizing that existing rel tags need to be maintained. I can see a potential for such a problem, but in the same context I can see that webmaster creating far greater problems than just upseting rel=ahah. That's right. It was a good reminder that the page as coded isn't the same page that ends up with the user. Similar issues are where links are given class attributes by some script to achieve different effects, but this in turn breaks the class=url attribute that was on it. That attribute is still needed, but it does mean that the people writing these scripts, and those of us using them, will have to be more careful in how they're applied. Here's a thought (more of a Javascript issue than a microformat issue; we can take offline is anyone objects): would it be possible to pipeline in a common file with a single scanner that any such widgets could attach to? (I don't know Javascript well enough to know the answer to that.) Yes, it is possible. Instead of getElementsByClassName, you could set up an array structure with two elements, the names to be looked for and some function to be applied to them. A final script after all the others would activate the search so that the page can be processed for the items in the array, and then acted upon So yes, it is possible. It would be a heavy burden, so I'm suggesting that the javascript code he talks about is moved into the function itself, so that the content author just has to bring in the code and apply a rel attribute and a few id attributes. I don't see it. Can you give code examples? The code he talks about is where the function accepts arguments which contain the elements to be worked upon. The code sample he gives is script ... var parent = document.getElementById('foo'); var elements = parent.getElementsByTagName('a'); var Fantacy = new Fantasticulator(elements); Fantacy.init(); ... /script The thing is, we don't want to content author to have to write this code. If the content author isnt to write the code, then the code will have to try and find the appropriate parts itself, which will be less efficient but still workable. In our AHAH case, we can have an init section that find the elements and passes them on to be attached. The ahah attribute may be attached to any anchor, so we need to get all of them from the page. var els = document.getElementsByTagName('a'); Then we find any with the rel=ahah attribute, Array.forEach(els, function(el) { if ('ahah' == el.getAttribute('rel')) { and pass those elements on to a function that does the dirty work of attaching the event. this.attach(el); } Here's some similar code from before that demonstrates this. ahah = { init : function() { var elements = []; var els = document.getElementsByTagName('a'); Array.forEach(els, function(el) { if ('ahah' == el.getAttribute('rel')) { this.attach(el); } } ), attach : function(el) { var href = el.getAttribute('href'); var id = 'ahah-' + el.getAttribute('id'); addEvent(el, 'click', 'function(){ahah.get('+href+', '+'ahah-'+id+')'); } ); The biggest issue at hand is if this stuff is happening after the page finished loading, that the user received feedback on when
Re: [uf-discuss] Tutorial on AHAH (such a cool technology!)
From: Paul Wilkins [EMAIL PROTECTED] It might start to look something like this // beware, untested code, dragons may be lurking ahah = { init : function() { var els = document.getElementsByTagName('a'); Array.forEach(els, function(el) { var href = el.getAttribute('href'); var id = 'ahah-' + el.getAttribute('id'); addEvent(el, 'click', ''); }); }, get : function(url, target, delay) { // code as per normal } }; How close would something like this get to cleaning things up? -- Paul Wilkins ___ microformats-discuss mailing list microformats-discuss@microformats.org http://microformats.org/mailman/listinfo/microformats-discuss
Re: [uf-discuss] Tutorial on AHAH (such a cool technology!)
From: Paul Wilkins [EMAIL PROTECTED] It might start to look something like this Note to self, don't post when rushed for time. // beware, untested code, dragons may be lurking ahah = { init : function() { var els = document.getElementsByTagName('a'); Array.forEach(els, function(el) { var href = el.getAttribute('href'); var id = 'ahah-' + el.getAttribute('id'); addEvent(el, 'click', 'function(){ahah.get('+href+', '+id+')'); }); }, get : function(url, target, delay) { // code as per normal } }; How close would something like this get to cleaning things up? -- Paul Wilkins ___ microformats-discuss mailing list microformats-discuss@microformats.org http://microformats.org/mailman/listinfo/microformats-discuss
Re: [uf-discuss] Tutorial on AHAH (such a cool technology!)
From: Paul Wilkins [EMAIL PROTECTED] If I have some time I'll get a fully tested version of this fleshed out. // beware, untested code, dragons may be lurking ahah = { init : function() { var els = document.getElementsByTagName('a'); Array.forEach(els, function(el) { if ('ahah' == el.getAttribute('rel')) { var href = el.getAttribute('href'); var id = 'ahah-' + el.getAttribute('id'); addEvent(el, 'click', 'function(){ahah.get('+href+', '+'ahah-'+id+')'); } }); }, get : function(url, target, delay) { // code as per normal } }; How close would something like this get to cleaning things up? ___ microformats-discuss mailing list microformats-discuss@microformats.org http://microformats.org/mailman/listinfo/microformats-discuss
RE: [uf-discuss] Tutorial on AHAH (such a cool technology!)
Paul Wilkins wrote: Mike Schinkel wrote: Printable version please! Ane that doesn't take 12 pages to print... (He also grumbles about lack of back button in presentation but glad the presentation was not 96 pages...) The slideshow was built using S5, A Simple Standards-Based Slide Show System from Eric Meyer. http://meyerweb.com/eric/tools/s5/ Eric built S5 to scratch an itch, and now many others have taken to using it too. There are several ways to go back, arrow keys, page up, or mouse down to the info back and click on the arrows. Keyboard controls for it can be found at http://meyerweb.com/eric/tools/s5/features.html#controlcha t The keyboard controls aren't easily discoverable, especially for people viewing the slideshows and perhaps that's an improvement that can be suggested. Thanks for the link. I had seen various HTML slideshows used from evidently different sources, some with and some without visible controls, but didn't know Eric Meyer was the source of this one of them. I may be old school, but to me if there is no visible indicators of a control, or at least a link to a help file, they doesn't exist. As least not from a usability perspective. What's incredibly ironic is someone such as Eric Meyer who focuses on visual presentation would make such an error. Heck, his example presentation does not have visible controls; at least he could have included a help link to his keyboard shortcuts! You're right about the printing issue. a page per screen is too much. I wonder if there's a way to print on a virtual a5, and have two of those a5's appear on a single a4 page. BTW, it seems one can press T to toggle and get a printable view. If he added visible controls it would sure be the heck out of Powerpoint for the web! Another alternative that seems cleaner to me would be to code it like this and let your ahah.js annotate the link for you: a href=Waldorf-Astoria-Photo.html rel=ahahphoto/aOh course this last suggestion will probably run me afoul of the microformat police since rel=ahah hasn't even been officially proposed yet and I didn't bring it up on [uf-new]... ;-P Give it an id and the script can be robust while you're at it. I don't like the idea of javascript scraping the page for class names. Dustin Diaz covers this particular issue very well in Did I say class? No, I said rel ;-) Interestingly reading Diaz' article there were a lot of people with good points that disagreed with his suggestion. But whatever, I was more discussing an overall concept, not a specific implementation of Javascript or how to optimize it. Seems like I accidentially hit on one of your hotbuttons, though? :-) While it's convenient, it's slow, demanding, and at high risk of breaking. And microformats, as currently envisioned, are *not* at a high risk for breaking? As an aside, rel=ahah wouldn't be at a high risk of breaking because the author using the technique would author it so it didn't break (or can you see potentials where his authoring would break that are not abstract hypotheticals?) Also, how would Diaz' article apply if these AHAH links were littered throughout the document? His article addressed what seemed like typically a single widget, not multiple instances of the same widget scattered throughout a document. I think it would be a heavy burden to place on a content author to require them to write the Javascript code he talks about if they had to tag 10 different segments rather than just scan for a rel=ahah. I think these may well be two different use-cases that might deserve two different approaches. On a similar note, one a partner of mine is would on, how do you feel about scraping a document to find heading tags (H1..H3) so as to build a table of contents? How close would something like this get to cleaning things up? Anyway, I'm fundamentally not really a Javascript guy, I'm a URL guy. So my comments were focused on ensuring the URLs were treated right. If you are a Javascript guy that can optimize that stuff so it is still usable for the content author, it's all yours! -- -Mike Schinkel http://www.mikeschinkel.com/blogs/ http://www.welldesignedurls.org http://atlanta-web.org - http://t.oolicio.us It never ceases to amaze how many people will proactively debate away attempts to improve the web... If we're going to try to not use the class tag as an identifier for javascript functions, the trouble comes in making it easy for people to add the script to their page and use it. The following seems to do the trick. a href=Waldorf-Astoria-Photo.html rel=ahah id=waldorfphoto/a div class=ahah-waldorfnbsp;/div Then the script can get only what it needs, like the anchors, filter through them much more rapidly, perhaps with the wonderful forEach technique from http://dean.edwards.name/weblog/2006/07/enum/ and add the behavior to those elements with something like addEvent from
Re: [uf-discuss] Tutorial on AHAH (such a cool technology!)
From: Mike Schinkel [EMAIL PROTECTED] What's incredibly ironic is someone such as Eric Meyer who focuses on visual presentation would make such an error. Heck, his example presentation does not have visible controls; at least he could have included a help link to his keyboard shortcuts! If you mouse to the bottom right of the presentation (or press C) you'll find there are some minor controls, but you've got to either stumble upon them or know about them beforehand. What's really needed is for someone to take the S5 system and built upon it an easily discoverable system for nagivation and control, but that would mean finding someone with the time to put together the interface. BTW, it seems one can press T to toggle and get a printable view. If he added visible controls it would sure be the heck out of Powerpoint for the web! Unfortunately T only switches the view from slideshow to content. The printout isn't affected from either view. Perhaps there needs to be two print stylesheets, and have them switched to match the view. I don't like the idea of javascript scraping the page for class names. Dustin Diaz covers this particular issue very well in Did I say class? No, I said rel ;-) Class or rel, they're both handled the same, where some code typically has to go through every single element on the page and scrape up the wanted attributes. ID attributes are different because the computer creates a list of them beforehand. The significance is that having several scripts scrape over the page after it's loaded can be troublesome. For example, if a hot finger clicks on an anchor before it's had time for the event to be attached. In this case finding them via the id attributes isn't viable, so the next best thing to do it limit the number of elements that need to be searched through, to help the computer do its thing more quickly than if it were using some generic getElementsByClassName function. At least some of them allow you to supply extra info to help narrow down and pleed up the search, like http://www.dustindiaz.com/getelementsbyclass Interestingly reading Diaz' article there were a lot of people with good points that disagreed with his suggestion. But whatever, I was more discussing an overall concept, not a specific implementation of Javascript or how to optimize it. Seems like I accidentially hit on one of your hotbuttons, though? :-) Code performance is one of those, that's for sure. I'm glad we're using the rel attribute here though, for I perceive some trouble down the road with class names. With the growth in class names being used for purposes other than styling, there will be in a few years more and more trouble with them clashing together. Looking at the list of class names for microformats alone, http://microformats.org/wiki/existing-classes I can see names that have been used in previous created stylesheets. In light of this, my own development is going to feature a slow down in class names for attaching javascript events, and instead focus on methods that should prove to be more compatible with less troubles in the future. While it's convenient, it's slow, demanding, and at high risk of breaking. And microformats, as currently envisioned, are *not* at a high risk for breaking? They *are*are at more of a risk of breaking, but it's the best solution we have at the moment. As an aside, rel=ahah wouldn't be at a high risk of breaking because the author using the technique would author it so it didn't break (or can you see potentials where his authoring would break that are not abstract hypotheticals?) Sure thing. Take for example the case where some webmaster decides to specify the relevance of outgoing links. He may have a script that goes through adding rel tags to certain known links and domains, and leave empty those that it doesn't know about. That example is the problem I eventually tracked down, to help someone who's attributes weren't sticking, because another script that nobody had looked much at was playing around where it shouldn't have. The good thing about the rel is that The rel attribute specifies the relationship of the linked document with the current document. So rel=ahah is perfect to state that the link goes out to some AHAH content. Also, how would Diaz' article apply if these AHAH links were littered throughout the document? His article addressed what seemed like typically a single widget, not multiple instances of the same widget scattered throughout a document. The dilemma is when there are several types of widgets scattered throughout a document. Then each widget is going to be lining up behind each other, waiting for the chance to scan through and find the bits it needs. I think it would be a heavy burden to place on a content author to require them to write the Javascript code he talks about if they had to tag 10 different segments rather than just scan for a rel=ahah.
RE: [uf-discuss] Tutorial on AHAH (such a cool technology!)
Costello, Roger L. wrote: Hi Folks, I have created a tutorial on AHAH (Asynchronous HTML and HTTP) http://www.xfront.com/microformats/AHAH.html Comments welcome. Printable version please! Ane that doesn't take 12 pages to print... (He also grumbles about lack of back button in presentation but glad the presentation was not 96 pages...) The purpose of AHAH is to enable an HTML document to dynamically fetch HTML from other documents, thus creating one document that is an assembly of information from many HTML documents. I assume you got AHAH from the efforts documented here[1]? Provide a placeholder in your HTML document where you want the fetched HTML data to be inserted. Identify that placeholder using the id attribute, e.g.,/li Shades of ASP.NET! Now we've got client-side placeholders too! ;-P The target HTML document (the HTML that you are fetching) must not be a whole HTML document; it must just be an HTML fragment. How does that work with content types? If it is a fragment then it is not a valid text/html, right? Is there a content type of HTML Fragment? If not, shouldn't there be and it be used instead of what you are using? Alternately, shouldn't you include the full HTML head and body trimmings but then extract the innerText from body before inserting? I think this is actually something that could potentially even be discussed by W3C TAG for a finding on best practices (i.e. inclusion of HTML fragments.) Lastly, a href=javascript:ahah('Waldorf-Astoria-Photo.html','Photo');photo/a hides the content from search engines, which is not good. Christian Heilmann wrote: This example does that (except for the templating part): http://beginningjavascript.com/Chapter8/exampleXHR.html This approach is definitely better because it lets the search engines see the link: a href=perfect_day.txt onclick=return simplexhr.doxhr('txtcontainer1',this.href)Perfect Day/a Another alternative that seems cleaner to me would be to code it like this and let your ahah.js annotate the link for you: a href=Waldorf-Astoria-Photo.html rel=ahahphoto/a Oh course this last suggestion will probably run me afoul of the microformat police since rel=ahah hasn't even been officially proposed yet and I didn't bring it up on [uf-new]... ;-P -- -Mike Schinkel http://www.mikeschinkel.com/blogs/ http://www.welldesignedurls.org http://atlanta-web.org - http://t.oolicio.us It never ceases to amaze how many people will proactively debate away attempts to improve the web... [1] http://en.wikipedia.org/wiki/AHAH ___ microformats-discuss mailing list microformats-discuss@microformats.org http://microformats.org/mailman/listinfo/microformats-discuss
Re: [uf-discuss] Tutorial on AHAH (such a cool technology!)
I'm not sure if people are missing it or what... so here it is again: My point was that if you don't intend to send the user somewhere, you shouldn't use an anchor. woudn't the following presupposition be more exact? Providing the anchor with href and possible with the rel and class attributes you will offer to users the way to discover the information that you've treated as meaningful in separate context, and might be involved in the user's interest. If you think that 1) the info-snippets are closely coupled with the main page 2) no agent/user will want to traverse the info connected with the current context/page 3) you treat the action and the data that emerged at this action as the UI hint only, no dealing with the real information connections. Than the decision to use the button / javascript:ahah('') is really fine. The hint and UI is for browser only, then you are free to use the language related to the browser specific. In any contrary ways, your not sending the user somewhere will get to the not providing the user with information of any data related to the current one. My point that by href you don't send to, but provide with the information that the emdedded information is separate and meaningfull in the overall info-space (perhaps having the appopriate rest-api support), not only as trick for UI/browser level. -- Best regards, ~ Xasima Xirohata ~ ___ microformats-discuss mailing list microformats-discuss@microformats.org http://microformats.org/mailman/listinfo/microformats-discuss
Re: [uf-discuss] Tutorial on AHAH (such a cool technology!)
On 2/12/07, Benjamin West [EMAIL PROTECTED] wrote: Roger, Neat stuff. I thought it was pretty good, but take some issue with the following: a href=javascript:ahah('Waldorf-Astoria-Photo.html','Photo');photo/a The best practice is to wire the event up, and to use a button when the element is not truly a link. Something more like: button onclick=ahah('Waldorf-Astoria-Photo.html','Photo');photo/button or even better: button id=photo_changer type=button photo/button script type=text/javascript // must be done either after onload fires or after the element appears in the DOM... // find the element. photoButton = document.getElementById('photo_changer'); // wire up the event. photoButton.onclick = function () { ahah('Waldorf-Astoria-Photo.html','Photo'); }; /script -Ben Just one thing, button isn't a valid HTML tag. You'd be better off using span (unless you're working with the XML DOM of course). A. ___ microformats-discuss mailing list microformats-discuss@microformats.org http://microformats.org/mailman/listinfo/microformats-discuss
Re: [uf-discuss] Tutorial on AHAH (such a cool technology!)
On 2/13/07 4:30 AM, Ara Pehlivanian [EMAIL PROTECTED] wrote: On 2/12/07, Benjamin West [EMAIL PROTECTED] wrote: Roger, Neat stuff. I thought it was pretty good, but take some issue with the following: a href=javascript:ahah('Waldorf-Astoria-Photo.html','Photo');photo/a The best practice is to wire the event up, and to use a button when the element is not truly a link. Something more like: button onclick=ahah('Waldorf-Astoria-Photo.html','Photo');photo/button or even better: button id=photo_changer type=button photo/button script type=text/javascript // must be done either after onload fires or after the element appears in the DOM... // find the element. photoButton = document.getElementById('photo_changer'); // wire up the event. photoButton.onclick = function () { ahah('Waldorf-Astoria-Photo.html','Photo'); }; /script -Ben Just one thing, button isn't a valid HTML tag. You'd be better off using span (unless you're working with the XML DOM of course). button is a valid HTML4 tag. http://www.w3.org/TR/html401/interact/forms.html#h-17.5 Tantek ___ microformats-discuss mailing list microformats-discuss@microformats.org http://microformats.org/mailman/listinfo/microformats-discuss
Re: [uf-discuss] Tutorial on AHAH (such a cool technology!)
On 2/13/07, Tantek Çelik [EMAIL PROTECTED] wrote: button is a valid HTML4 tag. http://www.w3.org/TR/html401/interact/forms.html#h-17.5 Tantek Ouch. Having been schooled, Ara crawls ashamedly under a rock to lick his wounds. A. ___ microformats-discuss mailing list microformats-discuss@microformats.org http://microformats.org/mailman/listinfo/microformats-discuss
Re: [uf-discuss] Tutorial on AHAH (such a cool technology!)
On 2/13/07, Ara Pehlivanian [EMAIL PROTECTED] wrote: On 2/12/07, Benjamin West [EMAIL PROTECTED] wrote: Roger, Neat stuff. I thought it was pretty good, but take some issue with the following: a href=javascript:ahah('Waldorf-Astoria-Photo.html','Photo');photo/a The best practice is to wire the event up, and to use a button when the element is not truly a link. How is this not a link? You can link to a template that takes the data as a parameter: a href=hotels.php?h=waldorf id=photophoto/a Then you can use event handling to assign the ahah() function to the link and hijack the standard behaviour. You could even re-use the script, add another parameter and get the data back from the same template in two formats. This example does that (except for the templating part): http://beginningjavascript.com/Chapter8/exampleXHR.html This one even does the templating: http://beginningjavascript.com/Chapter10/examplePHPXHRgallery.php This will also make search engines index the detail page. Don't make things more complicated than they are. Modern scripting allows you to easily enhance real semantic HTML without having to rely on markup that only makes sense when scripting is enabled. cheers Chris -- Chris Heilmann Book: http://www.beginningjavascript.com Blog: http://www.wait-till-i.com Writing: http://icant.co.uk/ ___ microformats-discuss mailing list microformats-discuss@microformats.org http://microformats.org/mailman/listinfo/microformats-discuss
Re: [uf-discuss] Tutorial on AHAH (such a cool technology!)
Benjamin West wrote: a href=javascript:ahah('Waldorf-Astoria- Photo.html','Photo');photo/a The best practice is to wire the event up, and to use a button when the element is not truly a link. How is this not a link? You can link to a template that takes the data as a parameter: a href=hotels.php?h=waldorf id=photophoto/a The difference, of course, is the first example doesn't have a URI. Your example does have a URI. If clicking on an anchor element won't ever take you to a new page (because there is no URI), don't use the anchor element! I disagree. You should be practicing accessible, progressive enhancement. The first example does have a URI, it's the relative path to Waldorf-Astoria-Photo.html and should be set up to work from a spider, script disabled browser, or even a right-click to open link in new tab. Your practice of wiring javascript to a button is effectively hijacking the user's browser will do nothing except ensure the content is inaccessible to all but a few targeted user agents. a href=Waldorf-Astoria-Photo.html class=ahah-photophoto/a Works as a regular link and–once the right event handlers are assigned–will work as a JS-enhanced interface. James ___ microformats-discuss mailing list microformats-discuss@microformats.org http://microformats.org/mailman/listinfo/microformats-discuss
Re: [uf-discuss] Tutorial on AHAH (such a cool technology!)
I disagree. You should be practicing accessible, progressive enhancement. Agreed, so I don't think we're in disagreement. This was the reason for my comment. The first example does have a URI, it's the relative path to Waldorf-Astoria-Photo.html and should be set up to work from a spider, script disabled browser, or even a right-click to open link in new tab. I'm not sure if people are missing it or what... so here it is again: --- href=javascript:ahah('Waldorf-Astoria-Photo.html','Photo'); This is a link only browsers with javascript can possibly understand. My point was that if you don't intend to send the user somewhere, you shouldn't use an anchor. Your practice of wiring javascript to a button is effectively hijacking the user's browser will do nothing except ensure the content is inaccessible to all but a few targeted user agents. Perhaps. Or my suggestion reinforces the concept of using a button when you don't intend to send your visitors to another page, instead of a link. a href=Waldorf-Astoria-Photo.html class=ahah-photophoto/a I agree this is a better suggestion in this case /if/ the intent is to provide a fallback to take the user to a new page: something not possible in the original example. However, the intent to not send the user to another page isn't something you can fix with progressive enhancement. Works as a regular link and–once the right event handlers are assigned–will work as a JS-enhanced interface. James Thanks for pointing out the better solution. Ben West ___ microformats-discuss mailing list microformats-discuss@microformats.org http://microformats.org/mailman/listinfo/microformats-discuss
Re: [uf-discuss] Tutorial on AHAH (such a cool technology!)
Roger, Neat stuff. I thought it was pretty good, but take some issue with the following: a href=javascript:ahah('Waldorf-Astoria-Photo.html','Photo');photo/a The best practice is to wire the event up, and to use a button when the element is not truly a link. Something more like: button onclick=ahah('Waldorf-Astoria-Photo.html','Photo');photo/button or even better: button id=photo_changer type=button photo/button script type=text/javascript // must be done either after onload fires or after the element appears in the DOM... // find the element. photoButton = document.getElementById('photo_changer'); // wire up the event. photoButton.onclick = function () { ahah('Waldorf-Astoria-Photo.html','Photo'); }; /script -Ben On 2/10/07, Costello, Roger L. [EMAIL PROTECTED] wrote: Hi Folks, I have created a tutorial on AHAH (Asynchronous HTML and HTTP) http://www.xfront.com/microformats/AHAH.html Comments welcome. /Roger ___ microformats-discuss mailing list microformats-discuss@microformats.org http://microformats.org/mailman/listinfo/microformats-discuss ___ microformats-discuss mailing list microformats-discuss@microformats.org http://microformats.org/mailman/listinfo/microformats-discuss