Forum Moderators: open
I'm currently using frames and javascript to avoid orphan child pages but was considering moving to iframes until I read about the <object> possibility - but I've never seen an object tag reference an external HTML file... any further information would be greatly appreciated :)
I've never used <object> in this way, but I it should be fine - <object> can also replace the <img> tag. However, I'm not sure I see any advantage. Any of those three approaches -- frames, iframe, or object -- will always give the risk of search engines sending visitors straight to the external file. There's no way around that.
Here's the basics on the object element ---
ELEMENT
<object classid="URL" codebase="URL" data="URL" id="name" type="mime-type">ATTRIBUTES
1. classid: URL of the program needed to implement the object's content.
This is equivalent to the code attribute in the deprecated <applet> element.2. codebase: the URL of any plug-in needed
3. data: URL of the actual object, similar to the older src attribute
4. id: a unique name that can then be defined in CSS or used by JavaScript to access the object
5. type: The mime-type of the object, e.g. text/html
So fire up your browser, write a couple test pages, and let us know what you discover.
I guess I'll stick with iFrames after all. Thanks anyway, tedster.
As Tedster said, iframes don't solve the problem of orphaned pages, and have more disadvantages than regular frames when it comes to browser comatibility (although admittedly all the modern browsers have no problem with either frames or iframes. So I am wondering what you want to achieve? Why are you "switching all [your] files around so that they use iFrames instead of regular frames". It is a bit of a step backwards.
Frames have pros and cons. If, for you, the cons outweigh the pros (as they do for many, especially those who hang around WebmasterWorld) then you can get rid of them by flattening your page, using css, etc (look in the css forum's library). But using iframes or objects won't help.
Shawn
Then I can scrap the javascript, which firstly simplifies the page, and secondly, allows people who have javascript turned off (grr) to see the website! I don't see how an iframe is technically any better or worse than a regular frame, but for my purposes I think it is the better choice.
However, if I could emulate the frame using css (without huge redundancy) that would be even better - any particular threads in the css forum I should take a look at?
"... don't see how an iframe is technically any better or worse than a regular frame...
Not supported by Netscape 4. Of course, since that is such an old and crappy browser, that may not concern you.
"...any particular threads in the css forum I should take a look at..."
Well, there may be redundancy, so it depends on what you are prepared to tolerate. You could have a look here:
[webmasterworld.com...]
or other threads here:
[webmasterworld.com...]
But if you are just using the iframe to prevent redundancy, not to have some part of your site static while the rest can scroll, you could use SSI or php includes.
Shawn