Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions capitulo 7/codigo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{ // Problema a y b de Cofla

let alto = window.screen.height;
let ancho = window.screen.width;

comprar = confirm(`El alto es: ${alto}, el ancho es ${ancho}`);

if (comprar){
alert("Compra realizada exitosamente");
}
else{
alert("Compra canecelada");
}

let href = window.location.href;
let pathname = window.location.pathname;
let hostname = window.location.hostname;
let protocol = window.location.protocol;

let html = `Protocolo: <b>${protocol}</b><br><br>`;
html += `Hostname: <b>${hostname}</b><br><br>`;
html += `Pathname: <b>${pathname}</b><br><br>`;
html += `URL completa: <b>${href}</b><br><br>`;

document.write(html);

}