jquery redirect
//Get current url:
path = $(location).attr('href');
//Redirect Using jQuery
var url = "http://jquery4u.com";
$(location).attr('href',url);
$(function() {
path = $(location).attr('href');
console.log(path);
if (path.indexOf("1811") != -1) {
$(location).attr('href','/annual'); // change url
// OR
window.location.assign("//aacuweb.org/events"); // instantly redirect to new page
}
});
// redirect by date
$(function() {
var current = new Date();
var expiry = new Date("June 4, 2022 13:05:00")
if(current.getTime() < expiry.getTime()) {
window.location.assign("/emory/annual")
}
});