0.0.0 • Published 7 years ago
mgn-getincludes v0.0.0
mgn-getincludes ( Don't Need jQuery )
Use XMLHttpRequest to include html files. Use this for when you can not include with php and SSI.
Install
npm i mgn-getincludes -SOr Download raw data
↓ download "mgn-getincludes.js"
Import
import mgnInclude from 'mgn-getincludes';Constructor
new mgnInclude( element, path [, () => {} ] );| Argument | Data type | Default | Descroption | 
|---|---|---|---|
| element | String | - (Required) | Specify target element.ex) ".j-include" | 
| path | String | - (Required) | Insert file path. | 
| () => {} | Function | - | You can describe the process you want to execute after loading data here. | 
Property
| Property | Data type | Default | Descroption | 
|---|---|---|---|
| element | String (Required) | - | Same as parameter. | 
| path | String | - (Required) | Same as parameter. | 
| func | Function | - | Same as parameter. | 
Sample code
// HTML
<div id="j-include_header"></div>// JS
import mgnInclude from 'mgn-getincludes';
new mgnInclude( "#j-include_header", "./path/to/header.html", () => {
    console.log(1);
} );0.0.0
7 years ago