Код: Выделить всё
// detects when the user clicks.
document.addEventListener("click", function(event) {
//checks if a user clicks on a hyperlink specifically.
const target = event.target.closest("a")
//This section makes it so the link is not immediately opened.
if (target) {event.preventDefault();
// Makes the pop up and shows the full link to the user, they decide if they want to proceed.
if (confirm("You clicked on a link!"+"\nAre you confident you want to proceed?\n\n\n" + target.href)) {
window.location.href = target.href;
}
}
}, true);
< /code>
Я просмотрел несколько разных форумов и часто задаваемых вопросов для хорошего ответа, но я не видел никого с той же проблемой. Я испортился с
window.location.href = target.href;}}}, true);Подробнее здесь: https://stackoverflow.com/questions/795 ... pop-up-the
Мобильная версия