Insert dynamically loaded contents on the web page. Currently, it supports html and markdown.
You can pass a data-format and a data-src.
<script async src='insert.js' data-format='html' data-src='some.html'></script>
<script async src='insert.js' data-format='markdown' data-src='some.md'></script>
insert.js reveals below APIs when data-src is not given.
- insert(position, {format, src})
- insertHtml(position, {src})
- insertMarkdown(position, {src})
- insertHere({format, src})
- insertHtmlHere({src})
- insertMarkdownHere({src})
<script src='insert.js'></script>
<div id='a'></div>
<script>
insertHere({format: 'markdown', src: 'some.md'});
insert(document.getElementById('a'), {format: 'html', src: 'some.html'});
</script>