A Detailed Introduction To Custom Elements

/introduction-to-custom-elements

  • A Detailed Introduction To Custom Elements | Smashing Coding
    http://coding.smashingmagazine.com/2014/03/04/introduction-to-custom-elements

    Custom Elements, a method of defining your own elements, with their own behavior and properties.

    exemple1 :

    <google-maps latitude="-8.034881" longitude="-34.918377"></google-maps>

    exemple2 :

    <table is="great-apes">…</table>

    The humble table element may now have its own #API. For example, it could query its own data in a standardized interface. A table that has an API to query its own data!!! How can you not be excited by that?

    le raccourci « ressource » de SPIP pourrait bien interagir avec cette méthode

    #HTML5 #polymer

    • Pour décrire des nouveaux tags HTML, en héritant éventuellement de tags existants.

      Ne marche qu’avec #Javascript

      Using Custom Elements comes with one big caveat: JavaScript is required. Without it, your brand new element simply won’t work and will fall back to being a plain old HTMLUnknownElement. Unless your element gets adopted natively by browsers, there’s simply no way around this. Just plan for a graceful fallback, as you should be doing with JavaScript anyway.