Skip to content

Just a simple javascript/jQuery thingy which can import/include other html files

License

Notifications You must be signed in to change notification settings

Divran/importer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

importer

Just a simple javascript/jQuery thingy which can import/include other html files

How to use

Don't forget to read the file itself for more documentation on each function!

  <!-- first import jquery and this file (order doesn't matter) -->
  <script type="text/javascript" src="js/importer.js"></script>
  <script type="text/javascript" src="js/jquery.min.js"></script>
  
  <script>
    // Next, initialize importer
    $(document).ready(function() {
      importer.initialize(
        "#container",
        {
          "index":"index.html",
          "about":"about.html",
          "contact":"contact.html",
        },
        function(){console.log("I'm alive!");},
        "index"
      );
    });
  
    // Next, when the user clicks a button, load a page
    $("#someButton").click(function() {
      importer.load(
        "#container",
        "about.html",
        function(){console.log("the about page just loaded!");},
        "about"
      );
    });
  
    // And we're done.
  </script>

About

Just a simple javascript/jQuery thingy which can import/include other html files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published