Keith Devens .com |
Sunday, October 12, 2008 | ![]() |
| Less isn't more; just enough is more. – Milton Glaser | ||
|
| ← Comment RSS feeds | Great quote → |

Simon Willison (http://simon.incutio.com/) wrote:
Keith (http://www.keithdevens.com/) wrote:
Awesome, I'll check that out. I considered Javascript too. I've been sour on the whole client-side scripting thing in general, and especially fed up with the whole thing when I found out that you have to write to the browser in a completely different way if the page is XHTML. That was in an article by Mark Pilgrim on xml.com, I think, but I can't find it in my weblog archive.
Simon Willison (http://simon.incutio.com/) wrote:
Hehe tell me about it - when I switched my site to being served with application/xhtml ALL of my scripts stopped working on the spot! I figured out the solution the other day - you need to switch to using document.createElementNS in Mozilla but keep using document.createElement in IE. I've got a function to do just that in my blockquotes code now: http://simon.incutio.com/blockquotesNS.js
Feel free to post a comment below. Please see my comment policy.
Formatting Rules (No HTML):
Generated in about 0.164s.
(Used 8 db queries)

Yup the static caching thing caught me out soon after I installed it - I've had to knock the timeout on the front page down from 5 minutes to 1 minute to keep the time since thing updating properly.
If caching is an issue, a nice alternative is to generate the time_since information using javascript. With careful use of the DOM you can get the time since bit to appear in browsers that support the DOM and be silently skipped in older browsers, which isn't a problem as it's not an essntial part of the page. Hixie does this on http://ln.hixie.ch/ using some pretty funky Mozilla specific stuff.