I have a little issue with javascript.
I have a page and this page is abc.com (page A) then i have a link in this page, redirecting to def.com (page B) and when the user click in this link, I need the page def.com load, and so I need these (def.com) page redirects to ghi.com (page C) after 3 seconds. I tried some codes, but I can't solve it by myself, someone can help me?
document.addEventListener("DOMContentLoaded", function twoLinks() {
myTab = document.getElementById("redirect").onclick = setTimeout(function () {
document.getElementById("redirect").href = "http://www.def.com";
}, 1000);
if(myTab){
setTimeout(function(){
window.location('http://www.ghi.com/');
}, 3000);
}
});
Thanks in advance!
Edit: What I need is when the user click the link in PAGE A, the browser load the PAGE B and after 3 seconds they are redirected to PAGE C, all the pages at the same tab, but I don't have access to the page B or page C so, I can't put redirect links on then.