From 8066367ecdf9ddd4f00cbf6c0bfdf9eebd844f0c Mon Sep 17 00:00:00 2001 From: Joris Guyonvarch Date: Sat, 7 Mar 2015 20:28:24 +0100 Subject: Replacing var by const in javascript --- router.js | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/router.js b/router.js index 8af98ab..c6c2c03 100644 --- a/router.js +++ b/router.js @@ -4,15 +4,15 @@ this.addEventListener('load', router); function router() { - var url = location.hash.slice(2) || 'presentation'; - var contentElement = document.getElementById('content'); - var htmlElement = document.querySelector('html'); + const url = location.hash.slice(2) || 'presentation'; + const contentElement = document.getElementById('content'); + const htmlElement = document.querySelector('html'); addClass(htmlElement, 'waitCursor'); fetchFile('Pages/' + url + '.md', function(contentMd) { removeClass(htmlElement, 'waitCursor'); contentElement.innerHTML = markdown.toHTML(contentMd); }, function() { - var notFoundPage = '