-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
26 lines (25 loc) · 875 Bytes
/
script.js
File metadata and controls
26 lines (25 loc) · 875 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
function redirect(version) {
if (version === '1.0') {
window.location.href = 'https://academicpal.vercel.app/'; // Replace with your URL for Academic Pal 1.0
} else if (version === '2.0') {
window.location.href = 'https://academicpal.vercel.app/'; // Replace with your URL for Academic Pal 2.0
}
}
document.getElementById('entry-form').addEventListener('submit', function(event) {
event.preventDefault();
const form = event.target;
fetch(form.action, {
method: form.method,
body: new FormData(form),
headers: {
'Accept': 'application/json'
}
}).then(response => {
if (response.ok) {
form.reset();
document.getElementById('popup').style.display = 'flex';
} else {
alert('Something went wrong. Please try again.');
}
});
});