4 ms·
Frameset / iframe?
by tobyhinloopen 8y ago
Frameset / iframe?
- galaxyLogic 8y agoYou are right. IFrame creates an almost but not totally isolated page-environment. So in a sense IFrames are 'web-components". So what can Web-components offer over that? A simpler way of including them on a page with a single tag. Well, you must load the js-file too but a single js-file could contain multiple web-components I assume. The whole (?) point of components is isolating the interface from implementation, encapsulation, which WebComponents does nicely by providing a standard way of writing methods of the underlying ES6 class. We could say that WebComponents are smarter IFrames with a cleaner way to declare their interface. Another great thing about WebComponents is extending existing tags which makes it easy to prototype improvements to existing tags. For instance I wonder if IFrame could be made better by creating a web-component that extends them?