Jump to content
Sign in to follow this  
df_glazer

object tag in IE not working as expected

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>

Share this post


Link to post
Share on other sites

You should use an <iframe> element for that.

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...