Use requirejs for clientside scripting
diff --git a/dev/demo/session.html b/dev/demo/session.html
index 034771c..5b4ae6b 100644
--- a/dev/demo/session.html
+++ b/dev/demo/session.html
@@ -3,37 +3,7 @@
<head>
<title>Cookie demo</title>
<link type="text/css" rel="stylesheet" href="../css/kalamar.css" />
- <script src="../js/src/session.js"></script>
- <script>
-
-var cookey;
-
-function add (val) {
- var list = document.getElementById('number');
- list.textContent += '-' + val;
- cookey.set('n', list.textContent);
-};
-
-function removeCookie () {
- cookey.clear();
-};
-
-document.addEventListener('DOMContentLoaded', function () {
- cookey = KorAP.Session.create('peter');
- document.getElementById('number').textContent = cookey.get('n') || '';
-
- var elements = document.getElementsByClassName('num');
- for (var i = 0; i < elements.length; i++) {
- elements[i].addEventListener(
- 'click',
- function (e) {
- add(this.textContent);
- }
- );
- };
-});
-
- </script>
+ <script data-main="sessiondemo.js" src="../js/lib/require.js" async="async"></script>
</head>
<body>
<div id="number"></div>