Hello. I'm Aleksandar Vacić, professional web developer and wine maker in the making.
Learn more about me or see what I can do for you.

My work & services

Insert HTML page into another HTML page

…or what to use instead of iframe in XHTML Strict pages.

I have added some kayak.com ads the other night, to the archive pages related to traveling. These ads are actually full-featured search snippets that allows you to directly search kayak.com database. Very handy things.

Sadly, they are written the old-fashion way, with quirks mode in mind, and worse yet — they are writing nested table tag soup directly into the page — no iframe thingie, like Google AdSense is doing. Thus, when my CSS files got applied to it, the snippet fell apart.
Luckily, the snippet always opens a new window, thus I quickly coded in an iframe in which the snippet is displayed. Which was all dandy…apart from the fact that my pages are XHTML 1.0 Strict, in which iframe is banned element. Jolly.

Correct way to include another HTML page into another is by object. The element which only purpose is to insert any foreign object into nice and structured web page.The standard way of coding an object element is to use appropriate MIME type and add the foreign object’s URL. Naturally, this does not work in IE6 (nor IE7) so I had to look for the infamous clsid value for text/html.

This proved to be quite a task, as I could not find any reference for that and after trying for 10 minutes I gave up and opened regedit, found the clsid branch and started arrowing-down until I found what I needed. After that, it was easy:

HTML:
  1. <!--[if IE]>
  2. <object classid="clsid:25336920-03F9-11CF-8FD0-00AA00686F13" data="some.html">
  3. <p>backup content</p>
  4. </object>
  5. <![endif]-->
  6.  
  7. <!--[if !IE]> <-->
  8. <object type="text/html" data="some.html">
  9. <p>backup content</p>
  10. </object>
  11. <!--> <![endif]-->

This worked like a charm, but in IE (both 6 and 7) it shows with an ugly border and scrollbar, even though the content itself was less than the width and height of the object element. It turned out that I need to specify this in the included page:

HTML:
  1. ....
  2. <body style="border:0;overflow:visible">
  3. ....

With this, you get seamless integration of external .html (or .asp or .php or whatever) into current web page.

[update, Nov 24th] Looking at the code, above, I think that p with the backup content is not really necessary. That would be displayed if for some reson the object could not be displayed. But the object data handler is the browser itself, not some external plugin, thus it is always present. Just object is enough (thus the strike through line in the example above).

[update, Nov 28th] Brad Wright chimed in with a valid argument that object may not be supported in all user agents. Backup content should be used.

Update, June 5, 2008: This post turned to be a hit. I never intended it to be a solution to everything, only to a particular problem I had at the time (I’m not even showing kayak.com ads anymore).
A lot of people add comments that the scrollbar-fix is not working. Note that included page in my case was non-standard tag-soup page, thus the two given styles somehow resolved my issue, without any promises it will work in all cases.
A lot of issues came up in comments for which I don’t have a solution (of the top of my head) nor time and incentive to investigate further. If I ever do, I’ll write it up. In the mean time, you’re on your own.

Translated to: Brazilian-Portuguese (by Mauricio Samy Silva).

tags: Web dev
Comments: 79

Posted 3 years, 9 months agopermanent link

trackback URL: http://aplus.rs/web-dev/insert-html-page-into-another-html-page/trackback/

Voices from the crowd, 79 so far

Thank you very much for this technique… although I have combined the two without conditional comments, it seems to work…

by Craig Francis
14 hours, 25 minutes after the post

You may also be interested in my post about integrating DailyMotion/YouTube videos in a strict XHTML document.

by Olivier Mengué
16 hours, 21 minutes after the post

Craig, I have edited your comment to remove the link — it lead to non-existing frame.html on my site. :) Please leave correct link to the example on your site (I assume that’s what you wanted)

Olivier, thank you for sharing that link — already added to my Ma.gnolia bookmarks.

by Aleksandar
16 hours, 58 minutes after the post

You can aslo do it without conditions as

backup content

by Rarkai
22 hours, 11 minutes after the post

Y’know, it’s a shame that the ‘target’ attribute got deprecated in XHTML.

Say index.html has something.html embedded (with “anything” for an id). And you’re particularly interested in showing an interesting element (with the ‘interesting’ id attribute) inside something.html … the relevant piece of code would look like this:

<a href=“something.html#interesting” target=“anything”>Go to the interesting section</a>
<object id=“anything” data=“something.html” type=“text/html”>
   <p>backup content<p>
</object>

by rolandog
1 day after the post

Wow! Thanks so much for this tip. It’s a near-ideal solution, since it doesn’t involve kludges at all.

by Tim McCormack
1 day, 4 hours after the post

Congratulations, you’ve just been del.icio.us –ed, your traffic might go up :)

by Neuromancer
1 day, 5 hours after the post

No problems Neuromancer, I think that Dreamhost can handle that. :)

rolandog, yes, target is much less hassle than setting page.onload scripts which intercept the click and route it to particular window (although I never tried that with an object). I understand why it was removed though — I got used to it so much that I mechanically added class=“Wnd” to such links :)

by Aleksandar
1 day, 15 hours after the post

Thanx, Its really working.…

by Suhas Dhoke
1 day, 16 hours after the post

Nice and useful post.

But why would you include this:


?

It’s a few more bites to your HTML without doing anything really.

by Nicolas R
2 days, 6 hours after the post

Nicolas, WP has striped the code from your post, thus I can’t figure out what part you are talking about.

by Aleksandar
2 days, 15 hours after the post

Works better if we put a “style” attribute to the tags…

by Rodrigo
3 days, 1 hour after the post

To satisfy my curiosity I tested this in a bunch of browsers: IE4 (pc), IE5 (pc) IE5.2 (mac), IE5.5 (pc), IE6 (pc), IE7 (pc), Mozilla 1.4 (pc), Mozilla Firefox 1.5 (mac & pc), Mozilla Firefox 2 (pc), NN4 (pc), NN6 (pc), NN7.1 (pc), NN8.1 (pc), Opera 6 (pc), Opera 7.2 (pc), Opera 9 (pc), Camino 1.03 (mac), iCab 3.03 (mac) ..
~ all good except for NN4 and NN6 which show the !IE alternative content, plus Opera 6 timed out on first attempt at loading object page, (which was quite big)

I also noticed that in IE6 at least, you can’t load up pages from another domain..

Does anyone know if there is any way to manipulate the DOM of the page loaded into the Object, so that the required border and overflow settings can be added dynamically? :)

by Dan
6 days, 2 hours after the post

Also, the reason why we need a fall back (such as the p element in your example) is so users whose user agents (such as screen readers) don’t understand the object element will still get some useful content.

Apparently JAWS is a particularly well-known example of a user agent which has trouble with this element. Thus the non-object fall back should always be provided.

by Brad Wright
6 days, 2 hours after the post

Web Wibble — 1

Some links for your enjoyment.

Visitor Segmentation in Web Analytics
focuses on using Google Analytics for vistor segmentation and analysis. Very handy intro for the uninitiated. Join the discussion at the SEO Refugee SEO forums.
How to insert an HTM

by things of sorts
6 days, 2 hours after the post

This did not work to include URLs of the different domains such as
<object classid=“clsid:25336920-03F9-11CF-8FD0-00AA00686F13” data=“http://www.google.com”><object>
although this works on Firefox and iframe tag can do it.
Precisely, this works on local machine, but it will not work after uploading to a server (because the domain of the HTML file and the domain of the target URL will be different.)

by moge
1 week after the post

Hi Aleksandar, I think the example I posted was cleaned by WordPress… trying again with htmlentities

<div style=“border: 3px solid #F00;”>
<object classid=“clsid:25336920-03F9-11CF-8FD0-00AA00686F13” type=“text/html” data=“frame.html” style=“height: 300px; width: 500px; display: block;”>
<p>View the <a href=”./frame.html”>Child Frames Content</a></p>
</object>
</div>

by Craig Francis
1 week, 1 day after the post

hai

i need ur help…my problem is i dont know how to take one html page content to another html page content.…plz help very urgent
regards
madi

by madi
1 week, 2 days after the post

Ofcourse you need the backup content. It’s there for browsers that doesn’t support the object tag (or for some reason allows the user to turn the support for it off).

by Håvard Pedersen
1 week, 2 days after the post

ok dudes,

I’m trying this.. but in a unique way.
I’m using this inside of a CMS called MODx.
I have it loading, but it’s only loading like 250px X 200px or something and with scrollbars.
The DIV it’s inside of has plenty of space for it to open up and be “mr. friendly object”, but right now it’s being “mr. object with a poor attitude”. How do I get my object to really
come out of itself and show it’s true colors?
Is there an object self esteem book or course I can turn it onto so it becomes
more friendly within a CMS? Maybe it has code-social-anxiety , or CSA, I heard some scripts don’t work in CMS’s well and this could be one of the cases where the object .. isn’t happy.
I don’t know what I’ve done, but I don’t know anyone with familiarity in such awkward and unique circumstances. If someone can help me, that would be …
stupdendous.
Keep up the good work everyone.

by jnothing
1 week, 3 days after the post

I’m using this inside MODx CMS and it’s not opening to fill the div that it’s inside of.
It’s very small in size and has scrollbars. I’m not sure where to add the additional (if IE..) script here but one place I tried it in rendered it black with no display at all.
If someone could help me it would be great. I’m doing a relatively low budget favor for someone and I’m very stuck and it’s starting to cost me money.

Cheers,

J

by jnothing
1 week, 3 days after the post

Hey all, this is my first time on the blog, was looking for some online help and came across it. This is my problem.

I have created and exported a navigation bar with dropdown menus (my client’s idea not mine) The project evolved into a wordpress 2.0 site in which this navigation bar needs to be incorporated.

So this is my problem. Now obviously the navigation bar has an .htm file extension with an image folder which accompanies it. So now I need to insert this into the index of my site. I have tried everything — everything — including the help found on this post. I have even tried to insert the html (found in the source of the navigation .htm file) what that provides me with is the image of the nav bar but it does not display the dropdown menu.

Any ideas — this is a crisis and really need to help.

Thanks all

Paul

by Paul Page
1 week, 4 days after the post

Hello, I’m a newbie to this place too…

Paul: You need to describe your dropdown nav bar further, or provide an example. But is it wise, these days, to use an “iframe approach” to navigational links? At the very least I would load the content into a single iframe or “CLSID’d Object”, and just insert the links directly into the parent page. Or use another iframe/object. But by then, you might as well go the whole hog and use a begrudged .

It depends on your opinion on the target attribute really, as mentioned above. I still wonder why it was deprecated sometimes — then again, I say stick with HTML 4.01 Strict for now, so at least the browser doesn’t go into quirks mode, if you don’t feel the need for XHTML yet. Which I don’t, to be honest… Sometimes I do feel like tweaking the schema for myself, lol, just to let me use SHORTTAG=“YES”.

by Marc Kirkwood
1 week, 5 days after the post

i have a big problem…
i need to insert into a webpage another page, for instance into an index.html page i want to be seen a part of a blog that is already published. how can i do? with layers? i don’t know the method…
the blog that will apear in that webpage, obviously will be updated regularly.

i hope someone can give me an idea.

many thanks in advance

by alex b
1 week, 6 days after the post

I have tried this method and it works well.
I am trying to replace one HTML with another by changing the contents of “data” attribute. It does not work, “data” is different but the object does not show the new HTML.
Have you run into this before? Can you propose a solution?

by Sagi B
2 weeks, 6 days after the post

Diskussion: statt Iframes ein Objekt einbinden…

Manchmal kommt man nicht umhin eine andere html Seite in die eigene einzubinden. Iframes sind eine Möglichkeit, doch ungeliebt, sind sie doch im XHTML strict Doctype nicht erwünscht. ALs object ginge dies doch. Doch auch hier gibt es Für…

by professional WebDesign barrierefrei
3 weeks, 3 days after the post

Great technique cheers!
But, will this have the same niggling fall backs as iframes when it comes to printing?

by Darren
3 weeks, 5 days after the post

Usando elementos Object en vez de iFrames…

Los iFrames son cada día menos populares y están siendo relegados dentro de los estándares de DOCTYPES (por ejemplo del “Strict” ya no incluye soporte para este tag) en los documentos HTML.
Pero no podemos negar su uilidad para resolver …

by Michael Müller C. | Diseño y Desarrollo Web, Estándares, CSS, HTML y más! | Guayaquil, Ecuador | Web Design Blog
4 weeks, 1 day after the post

Inserindo página HTML em uma página HTML

…ou, como simular iframe em documentos XHTML Strict.
Esta matéria é uma tradução de: Insert HTML page into another HTML page de autoria de Aleksandar Vacic
Uma noite destas eu precisei adicionar “ads” do kayak.com na minha página …

by Blog do Maujor
4 weeks, 1 day after the post

I’m looking for the key to how I can load different pages into my “object” using links in its parent. I’ve tried using “target” in links to the object’s id, and it works fine in Firefox, but not in IEANY ideas?

by dwyn
1 month after the post

I know it cannot load pages from another domain, so what’s the solution?
Google Adsense do that, so .…how?

by Riks
1 month after the post

Hi all,

Nice discussion over here. In order to work in IE you need to change the security settings to access the data sources accross the domain. But no way its going to be useful to us. Any other solution? Anybody else? Please

by Carbonrock
1 month, 1 week after the post

maybe you can use 3 pages:

1. xhtml/strict that uses object to include
2. html page that uses iframe to include
3. page you need to include (mozilla.org)
not tested — this is only an idea.

Ive also noticed that body border:0;overflow:visible does not solve my problem with border in IE.

by mynthon
1 month, 2 weeks after the post

Why use the object-tag for IE when you anyway using the comments) is valid you can gladly use the IFrame-element inside the conditional comments, IE will not care anyway, not today nor in the future…

by Martin Odhelius
1 month, 2 weeks after the post

Seems like half of my post went away because I used conditional comments inside my post… Here is an edited version:

Why use the object-tag for IE when you anyway using the conditional comments? If the reason is to just get “valid” code also for IE I can see why, but in the end you always know that IE supports IFrames and the code will validate anyway because of the conditional comments, so in the end this hack only turns out to be an end in itself, and in my opinion valid XHTML shall not be seen as an end in itself, it shall be seen as a way to grant compatibility, and as long as the “real” code (the one that is outside the conditional comments) is valid you can gladly use the IFrame-element inside the conditional comments, IE will not care anyway, not today nor in the future…

by Martin Odhelius
1 month, 2 weeks after the post

Great advice, thanks for this.
I’m trying to add a simple banner to my website at the top and then below it show a page from a different website. The problem is the object below has its own scrollbar and the main page has one as well. Is there a way around this? I can’t just hide one because otherwise the page won’t scroll correctly. Any ideas?

by rav
1 month, 3 weeks after the post

I am trying to figure out a way to change the parent webpage surrounding an iframe, while keeping the iframe content in-tact, on the new page. Any information/ideas on how to transfer iframe data from an iframe on one page, to a new iframe on another is greatly appreciated. Also if anyone knows how to input this code into an aiml file for a chatbot to execute, it would be greatly appreciated. Currently I can only get the chatbot to change the webpage inside the iframe, by using:

GO TO *

goTo.(‘http://www..com’)

Thanks for any assitance!
Shawn

by Shawn Souto
1 month, 3 weeks after the post

Won’t fetch any offsite content with IE/7

Instead of iframe I get better results with

Works perfectly except that relative links point at the host page rather than the inserted page. Would be nice to solve that problem.……

by Rhys
1 month, 4 weeks after the post

Helo, if you want more than one IFRAME, look here and analyze it. From this example one can learn a lot. (http://www.xing.com/)
nuno

by Webdesign Agentur
2 months, 1 week after the post

About the problem with the border in IE. As Carbonrock stated above, setting border:0;overflow:visible for the body tag does not solve the issue. But it may have worked for the author.

A real solution is that you need to set this style to root node of your document. If you load an entire webpage, this would be the html tag. If you only load “body content”, you need to set it to the body tag.

Hope this one helps

by Marco
2 months, 1 week after the post

Hi. I stumbled upon this post through Google. Thanks a lot for the inspiration! I am still struggling a bit getting this to work on IE, but otherwise this is exactly what I was looking for.

In return, I am happy to provide you with this link where I found some valuable information regarding the application of the JavaScript DOM to content in OBJECT tags (in response to the question posed by Dan in the comments).

Regards,
Habakuk

by Habakuk
2 months, 3 weeks after the post

The “border:0; overflow: visible;” for the body tag only works if IE is using its “classic” rendering engine, I believe. What this means is if you use a doc-type tag with a URL at the top of your HTML (e.g., doctype html .… “http://www.w3.org/TR/html4/loose.dtd”), it won’t work. If you remove the doc-type tag, it will work with IE6.

by Mark
3 months after the post

It’s very useful without iFrame, thanks, Alexandar! But u have to use “overflow-x” and overflow-y, Mark, it’s work really.

by Internetagentur Köln
3 months, 1 week after the post

I’m trying to add a simple banner to my website at the top and then below it show a page from a different website. The problem is the object below has its own scrollbar and the main page has one as well. Is there a way around this? I can’t just hide one because otherwise the page won’t scroll correctly. Any ideas?

by Tom
3 months, 1 week after the post

This seems like a great solution but I am having trouble getting it working on IE6. I have the following code but nothing is displayed in IE6. Firefox works fine.

backup content

Sorry for the stupid comment but does anyone have any idea why this is not working. I have checked the “clsid” and the ProgId for 25336920-03F9-11CF-8FD0-00aa00686F13 is “htmlfile”

by Peter
3 months, 2 weeks after the post

overflow-x and overflow-y don’t work with Opera. auto don’t work too. You can test it, but only overflow:scroll; works.
PS. Thanks for this!

by Mediation Bernadette
4 months, 2 weeks after the post

Thanks a bunch for this great Tip …i’m going to translate this article into german and send you response ;-)

Cheers,
Michael

by Michael
4 months, 3 weeks after the post

Hello,

thank you for the script

I have a problem with IE5.50

I have accueil.html that loads into index.html with the described method.

When loading accueil.html located in the included html page it works fine. However, when I press the back button adterwards, it loads the index.html AND accueil.html into the object tag of the original index.html.

I hope I am clear.

To see what I mean with IE5.50, go to http://fancytoes.freehostia.com/

Thank you!

by charlot
4 months, 3 weeks after the post

I just posted a comment.

I wanted to add thet I tried to put a target=“_top” to the link, i tried to pass the link with javascript in a onclick event, I’ve tried to put the focus in the mother window before pressing the back butto. None of these options made a difference, except for the javascript option, which produced unexpected results (it crashed IE once in a while). Don’t know why…

by charlot
4 months, 3 weeks after the post

I’m verry sorry, another update from what I’ve tried to resolve the problem.

I’ve added this onclick event to my included links:
onclick=“javascript:location.replace(this.href); event.returnValue=false; event.cancelBubble=true; return false“
it disables the back button. That is not ideal at all… Users with IE6+ will not be able to use the back button even if no problem occurs for them.

Therefore, if you have another solution, I would be glad to know about it!

by charlot
4 months, 3 weeks after the post

I am using your technique to load an external page.. such as http://www.google.com. I don’t know how Ad-sense does it but i am just using a javascript redirect on my object page. So i load up an initial object.html page and on the body onload of that blank page i go to http://www.google.com or where ever i want on the internet.

by Dom
6 months, 4 weeks after the post

Great idea on using object tag to do the job of iframe. The only problem in the end that I encountered when I experimented was that with Internet Explorer 7 I couldn’t get z-index working with the object tag. I have a pull down css menus and they would constantly render behind the object tag content. As usual Firefox 2 rendered the object tag with z-index and my pull down menus correctly.

Basicly the problem here is the same that was with Internet Explorer 6 and select elements and z-indexing not working.

Sight.

by Jukka
7 months, 1 week after the post

Hi, thx for sharing your insights. I looked into the problem because I wanted to include an Google Sheet into a Blogger post. I din’t got the object with the classid working in Internet Explorer 6. Therefore I adapted the code such that on IE an IFRAME displays the HTML and on other browser on OBJECT is displayed. This seams to work. I documented it in this post : How to include a HTML page into blogger posts ? (final). I think just using an IFRAME is probably easier.… An overview of techniques is documente in How to include a HTML page into blogger posts ? (final). I must admit that the Javascript I popose is causing redering problems in IE6.…
Kind regards

by cast42
8 months, 1 week after the post

If i understand well, inside the page you want to embed you have to put “”.

I tried to put that in may “some.html” example page end it doesn’t work, my embed page is still with border and scrollbar.…

Thanks in advance for your help.

J.

by jennifer
10 months, 4 weeks after the post

Very nice. Is there anyway to get javascript code from the embedded page to talk with the parent page?

by Jason Maronge
11 months, 4 weeks after the post

[…] Insert HTML page into another HTML page You aren’t allowed to use Iframe designing web-pages according to XHTML Strict Standard. The ultimative solution is the Object-Tag. […]

by Best of December 2006 | Best of the Month | Smashing Magazine
12 months after the post

I love the “plain text” link on the html boxes! that is so great and helpful as a visitor.

by woz
1 year after the post

I can’t seem to get rid of the border in IE7

Anyway, how can you automagically make the object’s size equal to that of the page that is being displayed in it? Otherwise, it would sorta defeat the purpose for me.

Oh yeah, for me, to get rid of the scrollbar, I had to use this:

html
{
background: #000000;
height:100%;
margin:0;
padding:0;
overflow:hidden;
}
body
{
background: #000000;
height:100%;
margin:0;
overflow:hidden;
padding:0;
}

Thanks all.

by Liam
1 year after the post

[…] Insert HTML page into another HTML page | published @ aplus moments […]

by Shaun Hoggan | links for 2008-03-23
1 year, 4 months after the post

hmmm.… this doesn’t seem to be working for me.… is it platform specific?

by Kalli
1 year, 4 months after the post

Hey Alek,

I have a question for you, but I just wanted to say what’s up first. I am an American Croatian, I know there’s tension but my cousin just married a orthodox serb. If that means anything to you. How’s the wine making coming, sounds like something I would enjoy but I only have enough room for japanese maples.

Anyways, I have a question. I used your technique in Joomla, but the IE fix isn’t working. I have loked for a solution but there isn’t doesn’t seem to be a straight forward solution, and I may just ditch the feature if I can’t get it to work. Any ideas? Thanks so much.

by mark
1 year, 6 months after the post

HELP me PLEASE!!! I am a lowly do it yourselfer when it comes to web design, and I am trying to save my company some time and do our website myself. my problem is that i am trying to display our online store on my homepage using the object tags. this wotks perfectly in Firefox but goes ape sh$$ in IE either not displaying the page at all or not displaying it and opening the store url in a new window. Is there any way to make this work, i tried the code you had above but i must have done something wrong because it did not work for me. If you could please help me i would appreciate it soo much.

Thanks
James cox
Unseen Racing

by James cox
1 year, 7 months after the post

The only thing I see is the bloody title (Insert HTML page into another HTML page) and then the comments… Where’s the post??? Tried using FF2IE7

by David
1 year, 8 months after the post

David, thanks for commenting.

Post is back up, I’ll blog about what the problem was.

by Aleksandar
1 year, 8 months after the post

Hey, I am trying to use this for asp.Net. Anyone have any suggestions? I am able to get the aspx page to show up, but the code-behind is not being registered, what should I do? I also tried to put an asp call to the code-behind, but that did not work.

And sorry that this is an out of date post.

by patrick
1 year, 11 months after the post

Thanks a lot Aleksandar, I was looking for this simple code for a while,
Quick question, as you can see, here (http://cyanatrendland.com/onlinestore) Id like to put a white background on this page,

If I put
its overriding the all page background– I would like to just have a white background around the

is it possible ?
Would love to have a little help on this :)

Thanks a lot

by Cyana
1 year, 11 months after the post

Can i somehow remove border and scrolling?

by Mike
1 year, 11 months after the post

I need your help. acually i am working on .net web application. My web pages are static. I need to change the browsing settings from one page to another page of particular text. I have no idea about this.

by Geetha Jeyalakshmi
1 year, 12 months after the post

OK. Have implemented these steps and it works great with IE and Safari. However, in Firefox the scroll bar and border remain. Any suggestions?

by Kevin Campbell
2 years, 2 months after the post

WOW ! Good code is always relevant. This solved my problem. It was compounded by using css for rollover links and an overlay graphic…but it worked. Thanks.

The only problems I had with the scroll bars were resolved by making the object size larger than the table I used in the included html. Once I got that figured out the scroll bars went away.

by Ron Bigus
2 years, 2 months after the post

If i am using external URL from different domain, it’s not displaying the page in object tag. Could you please help me out?

by Urvesh Vekariya
2 years, 3 months after the post

I thought I was getting mad where this worked for everyone except me.

Very very very **very** important note: please add an update in text that unless the target document is in Quirks mode the frame border will ALWAYS be rendered in IE. When you change doctype of target document to transitional for example — the border dissapears, as stupid as it sounds — thank you IE!

Please add this into text, this would save me at least an hour if I knew that.

This is where I found reference to that: http://intranation.com/test-cases/object-vs-iframe/

Also you should probably update your code like:

and replace with

most probably IE8 will render this properly therefore the fallback code is needed probably only for IE7 or IE6 (haven’t tested it though).

by yenc
2 years, 4 months after the post

thanks for this. was looking for a way to embed a Google Calendar without using the iFrame. This worked perfectly!

Cheers,
John

by john
2 years, 10 months after the post

Click to see website of mine and give me hint:

In “UNO Forums” page, I have a problem with fitting those forums in the annoyingly small area they provide. I’m rather new in WP so I don’t even know if it can be fitted, or if the right hand boxes can be re-arranged somehow. My php knowledge is way too minimal to understand whatta hack should I do.. :D

by Arto Parikka
3 years, 4 months after the post

Oh and, good job in code, btw.. Works in “normal” HTML sites well.. =)

by Arto Parikka
3 years, 4 months after the post

It doesn’t work in Flock browser… unless someone has already figured that out here.

by Dennis
3 years, 5 months after the post

Thank you so much, Aleksandar. It works great.

by Mihai Frumuselu
3 years, 6 months after the post

[…] doctype), y que no soportaba autoplay.El primer problema se puede solucionar fácilmente si usamos <object> en lugar de <iframe>, con un código como el que sigue. De esta forma, logramos la misma compatibilidad con todos los […]

by YouTube y su nueva forma de incrustar videos | Turleando
3 years, 8 months after the post

This worked great, just can’t figure out how to get the page to be more to the right.

by Paul Streubel
3 years, 8 months after the post

Post your opinion


? You need to enter your email, but rest assured it will not be published.

? Enter the link and it will be published.
? This blog strives to behave properly, as per XHTML 1.0 Strict spec. You can use the following tags, but please use them wisely:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
? I have enabled comment moderation so if your comment does not shows up after you submit it, don't worry. I will review it and if it's nice and to the point, I'll approve it. This measure is up mostly to fight spam and trolls.

Tags or categories or topics...

Lots of ramblings on this blog...might be easier for you to find your juice through these tags:

Post a job. Find one. authenticjobs.com