T
Thomas 'PointedEars' Lahn
Stephen said:Thomas said:Stephen said:[...]
SCmediaPlay.prototype.playSound=function()
{
this.removeObj();
this.objRef=document.createElement('embed');
There is no `embed' element in HTML, so this is not supposed to work in a
standards compliant UA. And any UA that supports DOM Level 2 Core should
also support the standards compliant `object' element, so you should
create that.
It's a matter of what can be made to work. You should know that the
existence of standards does not mean that they can be relied upon
unconditionally. One has to work with what is known to exist.
One should target standards first. Proprietary features are by definition
not interoperable or future-proof. We discussed this before.
I tried to use 'object' but IE wouldn't hide the plugin. Is there a
standard for that?
Incidentally, there is.
if(document.body && document.createElement)
That is an existence test, not a feature test. Read my posting again.
Is that according to a standard or just folklore?
It is a known fact.
As far as I could test, it does.
You see?
Initially I tried to avoid using setAttibute, but it didn't work on one
browser.
Which browser? Which property/attribute name?
I can test only within the scope of platforms and software available to
me.
Which is obviously insufficient.
PointedEars