Jump to content

object tag in IE not working as expected


df_glazer

Recommended Posts

Is it my imagination or does IE 8 really have a trouble executing the <object> tag. I have some javascript that loads an html fragment into an <object> tag the is wrapped in a div. The html fragment references a .xml file which puts a slideshow of a series of jpegs in the parent file. Works great in Firefox. Thought it would be an easy tweak to some settings to make it work in IE8. No luck. IE adds scrollbars and a grey border, worst of all it won’t load the content. Maybe there is a tweak I haven’t heard about…yet. Any advice would be GREATLY appreciated. These are the relevent code snippets, or see it in action at dg-ad.com: this snippet from the head:

<!--define links to open in as <obj> in a <div> using .js--><script type="text/javascript">function updatePortfolioFrame(which){document.getElementById('portfolio').innerHTML = '<'+'object id="pf_window" name="pf_window" type="text/html" data="'+which.href+'"><\/object>';} 

this one allows you to click on the words School of Nursing...:

 <a href="PF-Skinner.html" onclick="updatePortfolioFrame(this); panelWidget.loadContent('PF-Skinner-TXT.html'); setSldPnlState_1(1); Slide_1('PF_Text_Panel'); return false;">SCHOOL OF NURSING<br />SKINNER HALL<br />UMASS AMHERST</a><br /> 

which loads PF-Skinner.html into the object tag, the class portfolio defines a width and height, some float:

 <div id="portfolio">    <object type="text/html" name="pf_window" class="portfolio" id="pf_window"></object></div><!--End portfolio_window for slidewhows--></div>

Link to comment
Share on other sites

Ironically, the reason I have been engrossed in this project is because I wanted to get away from iframes. I can pretty easily reinstitute them and I did a ton of other improvements. It just seems like such an irritating thing to have a tag that just doesn't work in a product, IE, that was designed by the same company that introduced the object tag in the first place. Thanks for taking a look, I was afraid reverting to iframes may be the simplest recourse. Have a good week.

Link to comment
Share on other sites

There's nothing wrong with an iframe. The reasons against using them are the same reasons you could point out against using an <object> element for the same thing.

Link to comment
Share on other sites

Did you try with IE9? I'm pretty sure, but I might be wrong, that HTML 5 was not compatible in 8. It for sure is in IE9. Also from the looks at all of that code it does seem like it would be simpler to use an iframe seeing that all you would have to do is

<iframe src="URL HERE">MESSAGE FOR IF IT DOES NOT WORK HERE</iframe>

with other optional attributes like width and height

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...