Log in

View Full Version : The Object Tag...



pcbrainbuster
04-01-2007, 08:11 PM
Hello again :),

I do not completely understand how the object tag in HTML works, for example here is a script that uses the object tag to bring up a color box -

<html>
<body>
<object id="myDhelper"
classid="clsid:3050f819-98b5-11cf-bb82-00aa00bdce0b">
</object>
<button onclick="myDhelper.chooseColorDlg();">Show color dialog</button>
</body>
</html>

Some how without any code it brings up an color thing that would take hundreds of lines of code to do, how does this work ???...

I think I once read that the classid has unique ids that have certain functions added to them (even if this is true please give ALL the details of that code abpve and possibly extra if there is anything extra)...

Thanks :)

Twey
04-01-2007, 08:14 PM
The classid attribute is a URI (if the "magic GUIDs" IE uses can be called URIs) to a piece of code elsewhere. In this case, I'm guessing that GUID refers to an ActiveX control of some kind.

Note that this (ab)use of the <object> tag will work only in IE, and that accessing elements by using their IDs as identifiers in the global namespace is very deprecated, and should never be used.

pcbrainbuster
04-01-2007, 08:44 PM
Is there any more information available anywhere?

Twey
04-01-2007, 08:50 PM
Since it's IE-only (and Microsoft have never been lovers of documentation), documentation appears to be scarce.

pcbrainbuster
04-01-2007, 08:57 PM
So are you saying that I might as well forget anythig related to the object tag?

mburt
04-01-2007, 09:01 PM
Yes, he is :). Remember, it's IE only, and that's not user-friendly

pcbrainbuster
04-01-2007, 09:10 PM
Well oh well, away with object...

boxxertrumps
04-01-2007, 09:10 PM
no, the object tag is supported in all browsers, otherwise you couldn't use java in FF...
This preticular use is IE only.

mburt
04-01-2007, 09:16 PM
Yes, the use of ActiveX. (again, back to this topic)

pcbrainbuster
04-01-2007, 09:18 PM
I'm just throwing away object as I do not have any knowlegde of its features/purpose...

mburt
04-01-2007, 09:23 PM
The main use for object is to install Flash with the help of the param tag (http://www.w3schools.com/tags/tag_param.asp).

Twey
04-01-2007, 10:10 PM
It's used to embed external content. Flash, Java, and HTML can all be embedded into an HTML document using <object>, with varying degrees of success on different browsers.