Post Archive

› October 14, 2004

XHTML friendly Javascript for Flash

  • Reported by Nate
Geoff Stearns posted a helpful comment on an [older entry](http://web-graphics.com/mtarchive/001195.php#chatty003706), but I thought his offering should be made a little more prominent. What Geoff has provided is a re-usable and standardized javascript and publishing template that will output your object/embed tags, pass paramaters, do detection, and be XHTML friendly all the while. I haven't tried it yet, but is sure looks like a nice clean way of doing things. [Here's the link](http://blog.deconcept.com/2004/10/14/web-standards-compliant-javascript-flash-detect-and-embed/) to all the details about his "Web standards compliant Javascript Flash detect and embed".

Comments

1. October 19, 2004 09:52 AM

Quote this comment

Curcan Ovidiu Posted…

I just took a look at it... It's not XHTML friendly. In fact, it doesn't even work with XML (node.innerHTML and document.write() ring a bell?). So if you serve your document as application/xhtml+xml, it will simply break.

2. October 20, 2004 08:16 PM

Quote this comment

graphix Posted…

It think it's meant for XHTML transitional, not strict.

3. October 20, 2004 10:53 PM

Quote this comment

liorean Posted…

That doesn't make a difference. XHTML served as 'application/xhtml+xml' or 'application/xml' does not have document.write or element.innerHTML since those are connected with the HTML DOM. Any XHTML document; whether 1.0 Strict, Frameset, Transitional, 1.1 or 2.0, that is sent using one of those MIME types; will require that you use DOM Core, DOM XML or DOM LS methods. Only XHTML documents served as 'text/html' support document.write (from DOM HTML) and also only those documents support the proprietary element.innerHTML, since that is a compatibility layer.

4. October 23, 2004 04:30 PM

Quote this comment

Geoff Stearns Posted…

you're right, and I posted a response...

5. October 28, 2004 01:37 PM

Quote this comment

Lenny Cooper Posted…

Yeah, it’s meant for Xhtml transitional, not strict ;-)

6. November 23, 2004 06:55 PM

Quote this comment

Geoff Stearns Posted…

No, it will work with XHTML 1.0 strict and transitional, but only if you serve it with a mime type of text/html. If you serve your pages as XHTML 1.0 with a mime type of application/xhtml+xml, then the innerhtml and document.write calls will fail and it won't work.