Help - Search - Members - Calendar
Full Version: Accessing an Object from another Object
HTMLHelp Forums > Web Authoring > General Web Design
eagdl01
Apologies if this is a rookie question.
I'm trying to use objects instead of frames as I've read that frames are old hat.
I've created two object windows on my page using the following extracted code

<style>
#ob1 {position:absolute; left:0; top:200}
#ob2 {position:absolute; left:540; top:200}
</style>

<body>
<object id="ob1" data="inleft.htm" width="540" height="500">
</object>
<object id="ob2" data="inright.htm" width="540" height="500">
</object>

After initial display, I want to change the contents of ob1 by some action in ob2
along the lines of <a href="new.htm" target="ob1">
How do I reference ob1 from ob2?

Many thanks Geoff
pandy
You are describing frames. Use IFRAME. You can't do that with object, not with HTML alone anyway. Or you could consider not using that technique at all, but load a whole new page instead.
eagdl01
Thanks for the reply.

I take your point about using iframe etc,
the code <a href="new.htm" target="ob1"> I quoted was only an example of what I want to do.

What triggered my query were several articles saying frames are deprecated because objects can do everything that frames can.
Obviously the everything bit is not true if there is no equivalent to the target action (at least without scripting).

Similar articles also say that iframe is deprecated in favour of objects so I'm reluctant to use them, but they will do for now.

Anyway, thanks again for your comments.
Geoff
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.