Skip to content

Instantly share code, notes, and snippets.

@jonathanhotono
Created May 15, 2019 12:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonathanhotono/edbdbe11aeaad409ae04c33da88f5028 to your computer and use it in GitHub Desktop.
Save jonathanhotono/edbdbe11aeaad409ae04c33da88f5028 to your computer and use it in GitHub Desktop.
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