Embed HTML in a web page

When you are developing web applications is essential inserting HTML code in your website. There are many ways to do it: with iframe, with embed, and so on. But W3C recommends using the object tag:

<object type="text/html" data="http://example.com/app.html" width="100" height="100"></object>

Demostration

Source code of the demostration

To try the demo, copy this code and paste it into a text editor. Then save it as example.html and, finally, open the file with a browser.

<!doctype html>

<html>

  <head>
    <title>Embed HTML in a web page</title>
    <meta charset="utf-8" />
  </head>

  <body>
    <object type="text/html" data="http://dl.dropbox.com/u/11968143/apps/calculator/index.html" width="330" height="440"></object>
  </body>

</html>

2 comments:

  1. At the moment of this comment, Internet Explorer doesn't support importing HTML with the object tag recommended by W3.

    I hope in the future Microsoft will incorporate this feature!

    ReplyDelete
  2. Informative post sharing for the embed HTML in web pages. Thanks for the sharing. Best IT company in coimbatore | Best web site developer

    ReplyDelete