-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtoolSelector.js
More file actions
28 lines (24 loc) · 856 Bytes
/
toolSelector.js
File metadata and controls
28 lines (24 loc) · 856 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
27
28
//window.addEventListener('load', function () {
let url = new URL(window.location.href);
let identificador = url.searchParams.get("tid");
if (identificador === null) {
console.log("URL ERROR");
} else {
//let reference = firebase.database().ref('estudiantes/' + identificador);
console.log(identificador);
}
let element = document.createElement('h1');
element.innerHTML = identificador;
const bodyTag = document.querySelector("body");
bodyTag.appendChild(element);
const image = document.querySelector('#image');
let pathToImage = "/images/"+identificador+".png";
image.setAttribute("src", pathToImage);
const btn = document.querySelector('#btn');
btn.addEventListener("click",function() {
btn.href = '/files/'+identificador+'.pdf';
btn.target="_blank";
btn.click();
//location.href = "/files/"+identificador+".pdf";
});
//});