Thoughts on Declarative Ajax
Thursday, 19 October 2006
Dave Johnson writes up a nice summary of the issues of adding new elements to HTML for declarative Ajax, something that I ran into when doing HInclude.
Basically, IE doesn’t give you access to any non-HTML element that’s not in a namespace, and you have to access it by the full QName, so your hands are tied somewhat (e.g., the user can’t swap in a different prefix), but it’s doable. E.g.,
var includes = document.getElementsByTagName("hx:include");
if (includes.length == 0) { // remove ns for IE
includes = document.getElementsByTagName("include");
}
I’ve also received some grief about HInclude making HTML invalid, and therefore being a Bad Thing. I disagree — HTML has to be able to evolve, and Declarative Javascript is a nice way to do it. As Mark says, it’s a pendulum.
7 Comments
Asbjørn Ulsberg said:
Monday, October 30 2006 at 3:22 AM
Mark Nottingham said:
Monday, October 30 2006 at 7:36 AM
Aniket said:
Tuesday, November 7 2006 at 3:47 AM
Aniket said:
Tuesday, November 7 2006 at 3:55 AM
Mark Nottingham said:
Tuesday, November 7 2006 at 9:11 AM
Aniket said:
Tuesday, November 7 2006 at 9:58 AM
Mark Nottingham said:
Wednesday, November 8 2006 at 4:04 AM