views:

158

answers:

1

Hi, 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){
  alert(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!

+1  A: 

Hi, 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

Fibbers
Hi, thanks for the idea - I did try with a test.html using document.getElementById(...) instead of jQuery, and still had an issue, so I'm pretty sure it's something with the custom plug-in that needs to change. (I guess FF changed something with the way plug-ins work in 3.6.) Anyway thanks!
taber