I am trying to find array values in URL string? check the condition If requested URL contains array values then pass condition otherwise redirect to google.com
example
$(document).ready(function () {
var urls = ["/dept/ce/",
"/dept/cs",
"/dept/career",
"/dept/it",
"/dept/mkt/",
"/dept/Membership/"
, "/dept/pr"
, "/dept/PS"
, "/dept/ta"
, "/dept/wc"
, "/dept/PubsProducts"
, "_layouts/settings.aspx"
,"/_catalogs/masterpage/"];
//If document.location.href = "http://localhost/dept/ce/default.aspx"
//And Array has "/dept/ce" values
//Now check document.location.href against array values, if
//document.location.href contains array values then pass condition otherwise
//else condition
});
How to do this?