jquery-history-a

forked from https://github.com/balupton/jquery-history

Usage no npm install needed!

<script type="module">
  import jqueryHistoryA from 'https://cdn.skypack.dev/jquery-history-a';
</script>

README

forked from https://github.com/balupton/jquery-history


axisj-contributed

Dependencies

Install

npm install jquery-history-a
bower install jquery-history-a

Examples

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>jquery-history</title>
    <script src="bower_components/jquery/dist/jquery.min.js"></script>
    <script src="bower_components/ax5core/dist/ax5core.min.js"></script>
    <script src="../dist/jquery.history-a.js"></script>
</head>
<body style="padding: 20px;">
<div id="demo">
    <ul id="menu">
        <li><a href="#/apricots">Learn about Apricots</a></li>
        <li><a href="#/bananas">Lean about Bananas</a></li>
        <li><a href="#/coconuts">Learn about Coconuts</a></li>
    </ul>
</div>
<script>
    $(function () {
        // Bind a handler for ALL hash/state changes
        $.History.bind(function (state) {
            console.log(state);
        });

        // Bind a handler for state: apricots
        /*
        $.History.bind('/apricots', function (state) {

        });
        */
    });
</script>

</body>
</html>