[SWFObject] swfobject 1.4 broken in safari 2.0.3 in strict mode
Geoff Stearns
geoff at deconcept.com
Fri Apr 28 05:23:52 PDT 2006
interesting that safari's strict mode doesn't like
document.location.hash, but firefox is ok with it.
anyway, the dom stuff is a huge pain in the ass to get to work... i
could make adjustments to make it work in safari, but then it would
break in opera (opera is amazingly picky when creating elements that
aren't in the dom).
Then, ie doens't even support application/xhtm+xml...
I did notice that SWFObject does work in Firefox if you send your
pages as applicaton/xhtml+xml, because for some reason they left
innerHTML on, but it's not really a documented feature.
My stance on this subject is basically this: application/xhtml+xml is
a HUGE pain in the ass to get plugins in general to work when using
Javascript to write them. It seems that every browser requires
different tags and has different quirks, and I think it's just not
really worth it, since using 'real' xhtml doesn't really have any
advantage to 99% of the people out there.
Unless you are using MathML or otherwise extending xhtml, there
aren't any real benefits to it (not to mention shutting out IE users,
or sending a text/html version of your page anyway).
On Apr 28, 2006, at 2:06 AM, Josh Santangelo wrote:
> I'm working on a page which is in XHTML 1.1 strict, and SWF object
> breaks in Safari. I thought I'd post about it before trying to fix it.
>
> My document starts like this (served with an application/xhtml+xml
> header):
>
> <?xml version="1.0" encoding="utf-8"?>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
> "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml"
> xmlns:s="http://endquote.com/XMLShell/2.0/" xml:lang="en">
> <head>
> <meta http-equiv="content-type" content="application/xhtml+xml;
> charset=utf-8" />
>
> On line 161, it breaks if document.location.search is undefined.
> Replacing that line with this:
>
> var q = location.search || location.hash;
>
> Fixes it.
>
> Then it dies on line 106 with a "Dom Exception 7", which seems to mean
> you can't write to the innerHTML (a div in this case).
>
> It's looking like the solution is to do a bunch of DOM-style
> createElement calls, then removeChild all the children of the target
> node, then appendChild with the new Flash object.
>
> I could go ahead and make that change, but I thought I'd check to
> see if
> anyone can duplicate the error, or tell me why that solution would
> be a
> bad idea.
>
> thanks,
> -josh
> _______________________________________________
> SWFObject mailing list
> SWFObject at lists.deconcept.com
> http://lists.deconcept.com/listinfo.cgi/swfobject-deconcept.com
More information about the Swfobject
mailing list