I've read the similar questions on SO but none of them helps.
I have this JS
$(document).keypress(function(e) {
if(e.which == 13) {
var txt = $('#srch').val();
if (txt.toUpperCase() === "abc".toUpperCase()){
window.location= "http://somepage.html";
}
}
});
Its redirecting only on the index page. On the rest of the pages it's not redirecting. It's only putting a "?" on the end of the current URL.