|
|
|
@ -3,7 +3,9 @@
|
|
|
|
|
document.addEventListener('DOMContentLoaded', function () {
|
|
|
|
|
document.getElementById('goOnlineButton').addEventListener('click', function () {
|
|
|
|
|
var xhr = new XMLHttpRequest();
|
|
|
|
|
xhr.open('GET', "{% url 'go_online' %}", true);
|
|
|
|
|
// Access the URL from the data attribute
|
|
|
|
|
var url = this.getAttribute('data-url');
|
|
|
|
|
xhr.open('GET', url, true);
|
|
|
|
|
xhr.onload = function () {
|
|
|
|
|
if (xhr.status === 200) {
|
|
|
|
|
// If the request is successful, reload the top window
|
|
|
|
@ -14,4 +16,4 @@ document.addEventListener('DOMContentLoaded', function () {
|
|
|
|
|
};
|
|
|
|
|
xhr.send();
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|