Thanks for your response, but I'm not sure I explained myself well. Firstly, the images are not created with javascript. They're created on the server side after selecting information from a database and looping over a PHP array. Thus, the images would be available on the client-side without javascript. Thus, there are any number of ways I can use unobtrusive javascript to make sure that the images and "clickable" but also utilize the server-side programming to make sure that non-javascript browsers degrade to less responsive but more functional equivalents.
As for using class for styles, id for information, that would be great except that, as far as I'm aware, each id should only be used once per page. Since I need to send the id of the database record from the client to the sever for clicks on two different images, then I'd need two id's per row. Thus, I used the name field, which can be any thing we want it to and has no other syntactical meaning. What I'm really looking for is a way to avoid all of the inline functions in the javascript. for both of the each() function calls I create an inline function which has one parameter. Then, within that function I end up creating another inline function which takes no parameter but accesses the element.name property. It seems to me that, by doing things this way, the javascript becomes less understandable and the html -- while it remains quite clean and free of javascript -- lacks behavioral information that might otherwise help the stranded and confused future programmer of what's going on. Perhaps I'm worrying about things a bit to much, after all the site functions exactly the way I want it to, but it seems like a lot of "extra" work just to make the images click-able. I could just add an onclick attribute to the image and call a defined function which would execute the behavior that I desire. I guess, perhaps, what I'm looking for is a solid reason for unobtrusive javascript. So far, no one's been able to show me that it's a valuable technique. 'Course, I said the same thing about using CSS positioning for layouts and, by now, I've changed that tune. I suspect that, in time, I'll be convinced, but I don't think I'm there yet. > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
