Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
redirection script
var jsonData = [{
Url: "/sites/test/_layouts/15/viewlsts.aspx"
},
{
Url: "/sites/test2/_layouts/15/viewlsts.aspx"
}];
var data = jsonData.filter(function (item) {
if ((window.location.pathname.toLowerCase()).match(item.Url.toLowerCase())) {
return item;
}
});
if (data.length > 0 && data[0].Url) {
window.location.href = data.Url;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.