Reputation: 25
want to check if current url doesn't contains location.search do redirect to home before loading page
search page must have search location like : example.com/s/page.html?search=some+query
var home = "example.com",
searchpage="example.com/s/page.html";
check if current page url load
example.com/s/page.html
without ?search=some+query
redirect to home
how to translate "doesn't contains" in javascript / jquery
var search = window.location.search;
if(window.location.href!=search) {
window.location.href=home;
});
I know that's wrong
hope to redirect before page load content
thanx alot in advance
Upvotes: 0
Views: 811