On 2/5/11, Miller Medeiros <[email protected]> wrote:
Hey Miller.
> I'm currently working on a very specific kind of project right now where
> accessibility and SEO aren't a concern and the amount of markup required is
> minimal, since most of the content are images and/or videos... all the
> content should be loaded dynamically and the whole application lives in a
> single page...
>
OK.
> I started the project using markup for everything (stored in separate files
> and parsed with a template library) and using `innerHTML` to replace the
> content/estate of my application but after a couple days of development I
> started to migrate most of my code to pure DOM, creating most of the
> elements using `document.createElement`...
>
Sure, and then add innerHTML, right?
> for my specific case `document.createElement` seems a better approach since
> I can cache a reference to the created elements (and delete it later after
> switching content) instead of having to query for them again every time I
> append something to the innerHTML of the parentNode.. (which would make the
> cached reference point to the wrong element)
>
> Anyone has any thoughts about that? similar experiences? which one should be
> favored?
>
> PS: the app is only target for iPad, Chrome and Safari.
OK. I believe that with innerHTML a node reference can be obtained by
using `node.querySelector`. Stick to standards mode, not quirks.
Example:
var div = document.createElement("div");
div.innerHTML = buildPane();
var actuator = div.querySelector("a.actuator");
That should work in the browsers you are targeting, AFAIK. Anybody who
believes otherwise or knows of issues please post up, TIA.
> PS2: the project reminds a little bit this website
> http://www.wrangler-europe.com/wrangler/ - since I have a fullscreen
That took too long to load for me.
> interactive video as well and almost no copy.
Well I don't like that type of site at all. I prefer pages with clear
readable (largish) text with a few images. I don't like video unless
it is a particular video that I chose to watch and I hate it when
sites paly video or audio when I don't ask for it. Man like when
you're watching a site and all of a sudden it is blaring out I either
frantically clicking mute button or close the window or navigate away.
It can be really embarrassing.
WCAG talks about prerecorded audio and video.
http://www.w3.org/TR/WCAG20/
I would explain the problems with that to the client in writing. They
may have signed off on that design but you should make sure they know
about the consequences of doing that.
Well at least take care to watch out for a11y issues so that users
aren't blocked.
--
Garret
--
To view archived discussions from the original JSMentors Mailman list:
http://www.mail-archive.com/[email protected]/
To search via a non-Google archive, visit here:
http://www.mail-archive.com/[email protected]/
To unsubscribe from this group, send email to
[email protected]