mgn-getincludes

0.0.0 • Public • Published

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 -S

Or 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);
} );

Package Sidebar

Install

npm i mgn-getincludes

Weekly Downloads

0

Version

0.0.0

License

MIT

Unpacked Size

4.34 kB

Total Files

4

Last publish

Collaborators

  • frontend-isobar-jp