accessing embedded object with jquery not working in firefox 3.6
this code in my plugin used to work just fine:
jQuery('#embedded_obj', context).get(0).getVersion();
and the html...
<object id="embedded_obj" type="application/x-versionchecker-1.0.0.1"></object>
Basically trying to get the properties from an embedded object. But it looks like get(0) is returning an html object instead of the actual embedded object.
For example, if I do:
var launcher = jQuery('#embedded_obj', context).get(0);
for(prop in launcher){
aler开发者_如何学JAVAt(prop + ': ' + launcher[prop]);
}
... it alerts things like "getElementByNode," "scrollWidth," "clientLeft," "clientTop" etc.
Again this worked before Firefox 3.6. Has anyone else seen this or have any ideas/suggestions?
Thanks!
are you sure it worked before? jQuery(..).get(..) always returns a DOM object (in this case the <object>
element), so are you sure you didn't use a syntax like
var launcher = new VersionChecker(jQuery("#embedded_obj").get(0));
alert(launcher.getVersion());
So with a constructor that takes care of the link between the HTML DOM element and the actual embedded object?
If so, did you check it with a small test.html
file or so and open this with the two browsers to verify the difference in behaviour?
Edit: nevermind, there is really something strange going on indeed with the object-tag after I googled about it and stumbled on http://forum.jquery.com/topic/jquery-object-get-0-is-not-a-dom-element-in-ff-but-is-in-safari-is-this-a-bug
精彩评论