Skip to content

includeHTML - Include HTML parts (loading) via HTML tag (pure js)

License

Notifications You must be signed in to change notification settings

lgg-awesome/includeHTML

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

includeHTML

includeHTML - Loading HTML parts via HTML tag (pure js)

Supported protocols: http://, https://, file:///

Supported browsers: IE 9+, FF, Chrome (and may be other)

Installation

USAGE:

1.Insert includeHTML into head section in HTML file:

<script src="js/includeHTML.js"></script>

2.Anywhere use includeHTML as HTML tag:

<div><include src="header.html"></include></div>

ALL USAGE (examples):

1.Tag:

  <include scr="menu.html"></include>

2.Async:

    <script>
        includeHTML('header.html', document.getElementById('mainmenu'));
        includeHTML('menu.html', document.getElementById('pagemenu'));
    </script>

3.Sync:

    <script>
      includeHTML([
          ['header.html', document.getElementById('headder')],
          ['menu.html', document.getElementById('menu')],
          ['footer.html', document.getElementById('footer')]
      ], function(){
          //optional callback
      });
    </script>

Development

  • To build script run npm run build

About

includeHTML - Include HTML parts (loading) via HTML tag (pure js)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%