How can I check if the query string contains a q= in it using JavaScript or jQuery?
q=
var field = 'q'; var url = window.location.href; if(url.indexOf('?' + field + '=') != -1) return true; else if(url.indexOf('&' + field + '=') != -1) return true; return false