Skip to content
Snippets Groups Projects
Commit f337aa42 authored by psy's avatar psy
Browse files

listen to hashchange event

parent 8bdd7133
No related branches found
No related tags found
No related merge requests found
Pipeline #6256 passed
...@@ -21,12 +21,17 @@ ...@@ -21,12 +21,17 @@
<script type="text/javascript"> <script type="text/javascript">
function generateQR() { function generateQR() {
new QRCode(document.getElementById("qrcode"), location.hash.substring(1)); var qrcode = new QRCode(document.getElementById("qrcode"), location.hash.substring(1));
} }
$( document ).ready(function() { $( document ).ready(function() {
generateQR(); generateQR();
}); });
window.addEventListener('hashchange', function() {
qrcode.clear();
qrcode.makeCode(location.hash.substring(1));
});
</script> </script>
<footer> <footer>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment