From 1eafbe359acd68bd266c24e9fa80ab72ba67ca5d Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Wed, 27 Mar 2019 15:32:16 +0000 Subject: Redirect after no cp button clicked --- app/templates/annotate/index.html | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'app/templates') diff --git a/app/templates/annotate/index.html b/app/templates/annotate/index.html index a9ce8a7..793549a 100644 --- a/app/templates/annotate/index.html +++ b/app/templates/annotate/index.html @@ -302,6 +302,14 @@ nocp.onclick = function() { xhr.withCredentials = true; xhr.setRequestHeader("Content-Type", "application/json"); xhr.send(JSON.stringify(obj)); + xhr.onreadystatechange = function() { + if (xhr.readyState == XMLHttpRequest.DONE) { + if (xhr.status === 200) + window.location.href = xhr.responseText; + } else { + console.log("Error: " + xhr.status); + } + }; }; var submit = document.getElementById("btn-submit"); -- cgit v1.2.3