-
Notifications
You must be signed in to change notification settings - Fork 4
Embedding HTML via ccm components
Manfred Kaul edited this page Oct 14, 2018
·
5 revisions
How to load remote content into your web app? How to embed HTML using ccm Components?
Here are some ways to embed HTML using ccm components:
- via ccm tags with remote config
- via ccm.content.js and HTML import
- using ccm.start()
- via ccm.content.js and remote config
In detail:
<script src="https://ccmjs.github.io/akless-components/menu/versions/ccm.menu-2.4.0.js"></script>
<ccm-menu-2-4-0 key='["ccm.get","https://ccmjs.github.io/akless-components/menu/resources/configs.js","demo"]'></ccm-menu-2-4-0>
Attention: JSON-Format with Double Quotes required as values of HTML attributes
<script src="https://ccmjs.github.io/akless-components/content/ccm.content.js"></script>
<ccm-content inner='[ "ccm.load", "//kaul.inf.h-brs.de/data/2017/se1/le03.html" ]'></ccm-content>
or as nested HTML tag, which is interpreted by ccm as attribute definition:
<script src="https://ccmjs.github.io/akless-components/content/ccm.content.js"></script>
<ccm-content>
<ccm-load-inner src="https://kaul.inf.h-brs.de/data/2017/se1/le00.html"></ccm-load-inner>
</ccm-content>
<body>
<script src="https://ccmjs.github.io/ccm/ccm.js"></script>
<script>
ccm.start( 'https://ccmjs.github.io/akless-components/content/ccm.content.js', { root: document.body, inner: [ 'ccm.load', 'https://kaul.inf.h-brs.de/data/2017/se1/le00.html' ] } );
</script>
<script src="https://ccmjs.github.io/akless-components/content/ccm.content.js"></script>
<ccm-content key='["ccm.get","https://kaul.inf.h-brs.de/data/2017/se1/json/configs.js", "demo"]'></ccm-content>