diff options
| author | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2019-03-27 15:32:16 +0000 |
|---|---|---|
| committer | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2019-03-27 15:32:16 +0000 |
| commit | 1eafbe359acd68bd266c24e9fa80ab72ba67ca5d (patch) | |
| tree | 372af868adf659a455c18ca289631d7003b8b6de /app/templates | |
| parent | Allow admin to view annotations (diff) | |
| download | AnnotateChange-1eafbe359acd68bd266c24e9fa80ab72ba67ca5d.tar.gz AnnotateChange-1eafbe359acd68bd266c24e9fa80ab72ba67ca5d.zip | |
Redirect after no cp button clicked
Diffstat (limited to 'app/templates')
| -rw-r--r-- | app/templates/annotate/index.html | 8 |
1 files changed, 8 insertions, 0 deletions
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"); |
