Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions JavaScript_Basics/cookies.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Redirect to landing page if 'form_submitted' cookie does not exist

if (get_cookie('secondvisit') === null) {
window.location.href = "landing.html";
}

//Here setTimeout() is a built-in JavaScript function which can be used to execute another function after a given time interval.

function Redirect() {
window.location = "https://www.tutorialspoint.com";
}

document.write("You will be redirected to main page in 10 sec.");

setTimeout('Redirect()', 10000);