An open API service indexing awesome lists of open source software.

https://github.com/reiver/html-include

A web component for doing HTML includes: <html-include src="..."></html-include>
https://github.com/reiver/html-include

edge-side-include esi web-component

Last synced: 2 months ago
JSON representation

A web component for doing HTML includes: <html-include src="..."></html-include>

Awesome Lists containing this project

README

        

# ``

`` is a **web component** that lets you _include_ HTML at one URI into another HTML page.

You can think of this as a web-browser-side edge-side-include (ESI) — if you are familar with the server side ``.

## Example

```html



Example




Hello world!


```

## Basic Usage

The most basic way of using `` is:

```html

```

```html

```

```html

```

Note that in this _basic usage_ we just set the `src` attribute to point to the URI we want to include.

## Advanced Usage

A more advanced way using `` is:

```html

```
Note the addition of the ‘title’ attribute.

This usage will show a more informative loading message.
I.e., instead of showing:
> Loading…

… it will show:
> Loading “footer”…

I.e., it includes whatever is in the ‘title’ attribute in the loading-message.

## Debugging

If you need to debug what `` is doing you can use the `debug="true"` attribute. For example:

```html

```

```html

```

Note the addition of the ‘debug’ attribute, with the value set to the string "true".

This will call console.log() with logs that try to provide inside into what is doing internally.