SitePoint Sponsor

User Tag List

Results 1 to 18 of 18
  1. #1
    SitePoint Evangelist winterheat's Avatar
    Join Date
    Aug 2007
    Posts
    508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smile Embed is not in the HTML spec 3.2 or 4.0

    maybe i haven't asked before...

    embed is not really an official HTML 3.2 or 4.0 element...

    and it doesn't have a close tag </embed> isn't that true?

    on the other hand, <iframe> always requires a matching closing tag </iframe> or else it will be taken as things to display when iframe is not supported.

    is there a spec for the embed tag?



  2. #2
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,476
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There is no spec for EMBED because it's not real HTML.

  3. #3
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,869
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    The spec for the embed tag is that it requires both an opening <object> tag and a closing </object> tag. Depending on what you are trying to embed you may also need to put <param> tags in between (these don't need a closing tag). Where Internet Explorer requires a classid attribute on the <object> tag you may also need to nest a second <object> tag inside the first in order for all browsers to have an object tag that they can properly understand in order to embed your object into the page.

    Under no circumstances should an <embed> tag be incorporated as that tag has never existed and will result in your code not validating.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  4. #4
    SitePoint Evangelist winterheat's Avatar
    Join Date
    Aug 2007
    Posts
    508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ah... coz the company i work for use embed traditionally... so i kind of can't stop using it all of a sudden... unless if there is good reason and if it is 100% compatible with things... for one things, <embed> seems to be supported by all browsers we use... so for a practical standpoint that's ok for the moment being.

  5. #5
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,476
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There are a few options available. One is JavaScript, the other is the Flash Satay (though it does have two things going against it as far as accessibility goes, or at least it did back in 2005-2006; not sure about nowadays though).

  6. #6
    SitePoint Evangelist winterheat's Avatar
    Join Date
    Aug 2007
    Posts
    508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Dan Schulz View Post
    There are a few options available. One is JavaScript, the other is the Flash Satay (though it does have two things going against it as far as accessibility goes, or at least it did back in 2005-2006; not sure about nowadays though).
    i am sorry, do you mean these are options for not using <embed>? i thought the usual change is to replace that with <object>? so what is JS and Flash Satay used for?

  7. #7
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,476
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yep. You can see the Flash Satay here (note the final example in the article has a small errror, but the code examples earlier in the article are just fine). http://www.alistapart.com/articles/flashsatay/

  8. #8
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,869
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    http://www.alistapart.com/articles/byebyeembed/ shows how to replace an embed tag with a second object tag so as to get code that both works in all modern browsers and also validates.

    The JavaScript solution also seems popular although that doesn't work for those who don't have JavaScript - but then 99.9&#37; of the available web browsers don't understand the <embed> tag (although with the exception of Internet Explorer the other browsers that don't understand it only make up a fraction of 1% of current web users - although when you do include IE that is still more than half of the web community where the tag is ignored). There are only a handful of current browsers that do understand the embed tag and that is primarily for backwards support of pages written back when Netscape 4 was the most popular browser on the planet.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  9. #9
    SitePoint Evangelist winterheat's Avatar
    Join Date
    Aug 2007
    Posts
    508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by felgall View Post
    There are only a handful of current browsers that do understand the embed tag and that is primarily for backwards support of pages written back when Netscape 4 was the most popular browser on the planet.
    i thought IE 6, 7, Firefox, Safari all support <embed>... so that supposedly already is more than 95% of all browser used?

  10. #10
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,869
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    I though IE was the main browser that didn't support it - otherwise why do most sites use an object tag for IE with an embed nested inside it.

    Even so IE, Firefox and Safari are only three of the thousands of different browsers that exist and so my statement that 99&#37;+ of browsers don't support it is still correct.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  11. #11
    SitePoint Evangelist winterheat's Avatar
    Join Date
    Aug 2007
    Posts
    508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i thought like, if you go to www.rockyou.com
    then no <object> tag is there at all -- only <embed>, and the page is fully viewable in IE 6 or 7.

  12. #12
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,869
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    It is probably that IE was the first browser to allow it to be done properly with an object tag and so most people don't even consider whether or not it supports garbage ways of achieving the same result.

    The only difficulty is that in IE having been the first they implemented the object tag method slightly differently from other browsers and so a workaround is needed to get rid of the garbage and have it work in all 1000+ different browsers instead of only 3 or 4.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  13. #13
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <embed> is specced in HTML 5. It doesn't have a closing tag. I don't know of any browser in use today that doesn't support <embed>.

    One reason why <embed> was not added to HTML4, AIUI, is because it takes arbitrary attributes and that is not expressable with SGML DTDs.
    Simon Pieters

  14. #14
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I wish the HTML5 WG had spent some time convincing Microsoft to support object properly instead of adding an unnecessary, inferior element type to the specification.
    Birnam wood is come to Dunsinane

  15. #15
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Perhaps it's possible to do both...
    Simon Pieters

  16. #16
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,869
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    The last thing HTML needs is multiple tags that do basically the same thing. The embed tag is completely unnecessary and so adding it to the standard would greatly reduce the usefulness of the new standard since once the standard starts allowing some garbage, more garbage will surely follow until all you have left in the standard is garbage.

    Getting rid of the applet tag, iframe tag etc and replacing them all with the object tag was one of the steps that made a huge improvement to the current standard over the prior versions.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  17. #17
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by zcorpan View Post
    Perhaps it's possible to do both...
    What would be the point? If object were properly supported we could throw out img, iframe and applet and refrain from introducing embed.
    Birnam wood is come to Dunsinane

  18. #18
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,476
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    And besides, who cares about a language version that's not going to be ready for years anyway? (Yes, "parts" of it are being "introduced" - or dare I say retrofitted - now, but that's beside the point.)


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •