Sunday, May 29, 2005

Recipes Revisited

Back in January I discussed the the storage of recipe data using XML. Since then I have been playing with RSS feeds and XHTML and have decided I can use Blogger and RSS Feeds for my recipe storage.

Saturday, May 28, 2005

My Blogger Hack Part 1 Using Blogger to generate RSS 2.0

Wednesday, May 25, 2005

Make sure event handlers do not require use of a mouse

For event handlers that do more than just change the presentation of an element, such as change color when the mouse moves over an item, consider the following:

  • Use application-level event triggers rather than user interaction-level triggers. In HTML 4.0, application-level event attributes are "onfocus", "onblur" (the opposite of "onfocus"), and "onselect". These events are triggered when something happens on the page regardless of how the user causes it to happen. For example, an "onfocus" event occurs when a control receives the focus, whether that is done by clicking the mouse or by using the keyboard. By contrast, device-dependent events only occur when a particular device is in use. A "onmousedown" event, which also can give a control the focus, is only triggered by a mouse action, and other means of giving focus to the control will not be responded to
  • If you must use device-dependent attributes, provide redundant input mechanisms; for example, specify two handlers for the same element, both of which have the same code associated with them:
Device Handler Correspondences

Use...
...with
onmousedown
onkeydown
onmouseup
onkeyup
onclick
onkeypress
onmouseover
onfocus
onmouseout
onblur

Note:

There is no keyboard equivalent to double-clicking ("ondblclick") or mouse movement ("onmousemove") in HTML 4.0. Avoid using these features.

  • Do not write event handlers that rely on mouse coordinates since this requires device-independent input
Rationale

Event handlers respond to user actions, such as mouse movement, typing, voice input, etc. On web pages, event handlers often just change the presentation of an element, such as by changing the color of an image. Others, however, are parts of the functionality of the page. This functionality needs to be presented in a device-independent way so all users can access it, since not all users use a mouse.

Saturday, May 21, 2005

Pseudo-Class Selector Order

Interesting tidbit I learned today with using pseudo classes. As I'm sure anyone reading this article knows, with pseudo-classes you can style links in different ways in each of the four states.

  • :link
  • :visited
  • :hover
  • :active
The selector that specified later in the stylesheet will be used if there is any conflict. For this reason, link and link pseudo class selectors should always be used in the following order:
  1. a {}
  2. a:link {}
  3. a:visited {}
  4. a:hover {}
  5. a:active {}

You can combine states if needed, as long as the order (link and visited before hover and active) is maintained:
  • a:link, a:visited { color: blue; }
  • a:hover, a:active { color: red; }

Wednesday, February 09, 2005

Busted

Well I have been trying to fix the database layer for the blog for 2 days now. Not only have I busted the update feature I seemed to have busted the old XML method as well. I guess no more updates till I get it fixed.