sweetname Posted February 24, 2009 Share Posted February 24, 2009 I originally posted a question in the html section, but this is really more of a javascript question I think. Sorry about that. I have loaded a html page into an object (similar to an iframe) and I cannot figure out how to dynamically set the height. I have tried to approach it like an iframe, but this doesn't work. http://www.mattcutts.com/blog/iframe-height-scrollbar-example/ Can anyone help me figure out the height to set my object so that it doesn't have scroll bars? Thanks Quote Link to comment Share on other sites More sharing options...
webster08 Posted February 24, 2009 Share Posted February 24, 2009 what kind of object are you referring to? Quote Link to comment Share on other sites More sharing options...
sweetname Posted February 25, 2009 Author Share Posted February 25, 2009 the html object tag. here is an example link: http://aplus.rs/web-dev/insert-html-page-into-another-html-page/ (i couldn't post the code for some reason the comments were messing up the block.) Quote Link to comment Share on other sites More sharing options...
webster08 Posted February 25, 2009 Share Posted February 25, 2009 i don't think your going to be able to reference the object tag based on contentWindow; because contentWindow was meant to be used with FRAME, IFRAME, HTMLFrameElement Constructor, HTMLIFrameElement Constructor. you can find the oject tag's usable attributes here: http://www.w3schools.com/TAGS/tag_object.asp alternatively, you could hide an iframe with the same src and use the contentWindow method for that hidden iframe; too change the height of the object tag. Quote Link to comment Share on other sites More sharing options...
sweetname Posted February 25, 2009 Author Share Posted February 25, 2009 I know you can't do it that way. That is how it is done for iframes. I was trying to show the effect I am trying to mimic with the object. I want to use the object tag instead of iframe. Is it possible to achieve something similar with an object? I want to use an object tag so that I can validate. Thanks Quote Link to comment Share on other sites More sharing options...
webster08 Posted February 25, 2009 Share Posted February 25, 2009 read my edit above Quote Link to comment Share on other sites More sharing options...
sweetname Posted February 25, 2009 Author Share Posted February 25, 2009 The iframe tag wont validate in xhtml 1.0 strict and everything I read on blogs and such state that the object tag has replaced the iframe, however nobody shows how to fit the object height to the content in it. If I were to use a hidden iframe, what would be the point of using the object in the first place? I am a little confused by the suggestion? Please explain? Thanks Quote Link to comment Share on other sites More sharing options...
webster08 Posted February 26, 2009 Share Posted February 26, 2009 objects have not replaced iframe; each are probably used equally, but not for what your wanting to do. i really have never seen anyone include a html page in a object. one of the main reasons for that is; you can have more control over an iframe. it's up to you what you want to use to display your content, but it is not going to be as easy to manipulate an object, as it would be for any type of frame. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.